<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>keyczar.keyczar</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="keyczar-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            >Keyczar</th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="keyczar-module.html">Package&nbsp;keyczar</a> ::
        Module&nbsp;keyczar
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="keyczar.keyczar-pysrc.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<h1 class="epydoc">Source Code for <a href="keyczar.keyczar-module.html">Module keyczar.keyczar</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno">  1</tt>  <tt class="py-line"><tt class="py-comment">#!/usr/bin/python2.4</tt> </tt>
<a name="L2"></a><tt class="py-lineno">  2</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#</tt> </tt>
<a name="L3"></a><tt class="py-lineno">  3</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># Copyright 2008 Google Inc.</tt> </tt>
<a name="L4"></a><tt class="py-lineno">  4</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#</tt> </tt>
<a name="L5"></a><tt class="py-lineno">  5</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># Licensed under the Apache License, Version 2.0 (the "License");</tt> </tt>
<a name="L6"></a><tt class="py-lineno">  6</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># you may not use this file except in compliance with the License.</tt> </tt>
<a name="L7"></a><tt class="py-lineno">  7</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># You may obtain a copy of the License at</tt> </tt>
<a name="L8"></a><tt class="py-lineno">  8</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># </tt> </tt>
<a name="L9"></a><tt class="py-lineno">  9</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#      http://www.apache.org/licenses/LICENSE-2.0</tt> </tt>
<a name="L10"></a><tt class="py-lineno"> 10</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># </tt> </tt>
<a name="L11"></a><tt class="py-lineno"> 11</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># Unless required by applicable law or agreed to in writing, software</tt> </tt>
<a name="L12"></a><tt class="py-lineno"> 12</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># distributed under the License is distributed on an "AS IS" BASIS,</tt> </tt>
<a name="L13"></a><tt class="py-lineno"> 13</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</tt> </tt>
<a name="L14"></a><tt class="py-lineno"> 14</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># See the License for the specific language governing permissions and</tt> </tt>
<a name="L15"></a><tt class="py-lineno"> 15</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># limitations under the License.</tt> </tt>
<a name="L16"></a><tt class="py-lineno"> 16</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
<a name="L17"></a><tt class="py-lineno"> 17</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
<a name="L18"></a><tt class="py-lineno"> 18</tt>  <tt class="py-line"><tt class="py-docstring">Collection of all Keyczar classes used to perform cryptographic functions:</tt> </tt>
<a name="L19"></a><tt class="py-lineno"> 19</tt>  <tt class="py-line"><tt class="py-docstring">encrypt, decrypt, sign and verify.</tt> </tt>
<a name="L20"></a><tt class="py-lineno"> 20</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L21"></a><tt class="py-lineno"> 21</tt>  <tt class="py-line"><tt class="py-docstring">@author: arkajit.dey@gmail.com (Arkajit Dey)</tt> </tt>
<a name="L22"></a><tt class="py-lineno"> 22</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
<a name="L23"></a><tt class="py-lineno"> 23</tt>  <tt class="py-line"> </tt>
<a name="L24"></a><tt class="py-lineno"> 24</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">os</tt> </tt>
<a name="L25"></a><tt class="py-lineno"> 25</tt>  <tt class="py-line"> </tt>
<a name="L26"></a><tt class="py-lineno"> 26</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">Crypto</tt><tt class="py-op">.</tt><tt class="py-name">Cipher</tt> <tt class="py-keyword">import</tt> <tt id="link-0" class="py-name" targets="Variable keyczar.keyinfo.AES=keyczar.keyinfo-module.html#AES"><a title="keyczar.keyinfo.AES" class="py-name" href="#" onclick="return doclink('link-0', 'AES', 'link-0');">AES</a></tt> </tt>
<a name="L27"></a><tt class="py-lineno"> 27</tt>  <tt class="py-line"> </tt>
<a name="L28"></a><tt class="py-lineno"> 28</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt id="link-1" class="py-name" targets="Module keyczar.errors=keyczar.errors-module.html"><a title="keyczar.errors" class="py-name" href="#" onclick="return doclink('link-1', 'errors', 'link-1');">errors</a></tt> </tt>
<a name="L29"></a><tt class="py-lineno"> 29</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt id="link-2" class="py-name" targets="Module keyczar.keydata=keyczar.keydata-module.html"><a title="keyczar.keydata" class="py-name" href="#" onclick="return doclink('link-2', 'keydata', 'link-2');">keydata</a></tt> </tt>
<a name="L30"></a><tt class="py-lineno"> 30</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt id="link-3" class="py-name" targets="Module keyczar.keyinfo=keyczar.keyinfo-module.html"><a title="keyczar.keyinfo" class="py-name" href="#" onclick="return doclink('link-3', 'keyinfo', 'link-3');">keyinfo</a></tt> </tt>
<a name="L31"></a><tt class="py-lineno"> 31</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt id="link-4" class="py-name" targets="Module keyczar.keys=keyczar.keys-module.html"><a title="keyczar.keys" class="py-name" href="#" onclick="return doclink('link-4', 'keys', 'link-4');">keys</a></tt> </tt>
<a name="L32"></a><tt class="py-lineno"> 32</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt id="link-5" class="py-name" targets="Module keyczar.readers=keyczar.readers-module.html"><a title="keyczar.readers" class="py-name" href="#" onclick="return doclink('link-5', 'readers', 'link-5');">readers</a></tt> </tt>
<a name="L33"></a><tt class="py-lineno"> 33</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt id="link-6" class="py-name" targets="Module keyczar.util=keyczar.util-module.html"><a title="keyczar.util" class="py-name" href="#" onclick="return doclink('link-6', 'util', 'link-6');">util</a></tt> </tt>
<a name="L34"></a><tt class="py-lineno"> 34</tt>  <tt class="py-line"> </tt>
<a name="L35"></a><tt class="py-lineno"> 35</tt>  <tt class="py-line"><tt id="link-7" class="py-name" targets="Variable keyczar.keyczar.VERSION=keyczar.keyczar-module.html#VERSION,Variable keyczar.keyczart.VERSION=keyczar.keyczart-module.html#VERSION"><a title="keyczar.keyczar.VERSION
keyczar.keyczart.VERSION" class="py-name" href="#" onclick="return doclink('link-7', 'VERSION', 'link-7');">VERSION</a></tt> <tt class="py-op">=</tt> <tt class="py-number">1</tt> </tt>
<a name="L36"></a><tt class="py-lineno"> 36</tt>  <tt class="py-line"><tt id="link-8" class="py-name" targets="Variable keyczar.keyczar.KEY_HASH_SIZE=keyczar.keyczar-module.html#KEY_HASH_SIZE"><a title="keyczar.keyczar.KEY_HASH_SIZE" class="py-name" href="#" onclick="return doclink('link-8', 'KEY_HASH_SIZE', 'link-8');">KEY_HASH_SIZE</a></tt> <tt class="py-op">=</tt> <tt class="py-number">4</tt> </tt>
<a name="L37"></a><tt class="py-lineno"> 37</tt>  <tt class="py-line"><tt id="link-9" class="py-name" targets="Variable keyczar.keyczar.HEADER_SIZE=keyczar.keyczar-module.html#HEADER_SIZE"><a title="keyczar.keyczar.HEADER_SIZE" class="py-name" href="#" onclick="return doclink('link-9', 'HEADER_SIZE', 'link-9');">HEADER_SIZE</a></tt> <tt class="py-op">=</tt> <tt class="py-number">1</tt> <tt class="py-op">+</tt> <tt id="link-10" class="py-name"><a title="keyczar.keyczar.KEY_HASH_SIZE" class="py-name" href="#" onclick="return doclink('link-10', 'KEY_HASH_SIZE', 'link-8');">KEY_HASH_SIZE</a></tt> </tt>
<a name="Keyczar"></a><div id="Keyczar-def"><a name="L38"></a><tt class="py-lineno"> 38</tt>  <tt class="py-line"> </tt>
<a name="L39"></a><tt class="py-lineno"> 39</tt> <a class="py-toggle" href="#" id="Keyczar-toggle" onclick="return toggle('Keyczar');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="keyczar.keyczar.Keyczar-class.html">Keyczar</a><tt class="py-op">(</tt><tt class="py-base-class">object</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Keyczar-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="Keyczar-expanded"><a name="L40"></a><tt class="py-lineno"> 40</tt>  <tt class="py-line">  <tt class="py-docstring">"""Abstract Keyczar base class."""</tt> </tt>
<a name="L41"></a><tt class="py-lineno"> 41</tt>  <tt class="py-line">     </tt>
<a name="Keyczar.__init__"></a><div id="Keyczar.__init__-def"><a name="L42"></a><tt class="py-lineno"> 42</tt> <a class="py-toggle" href="#" id="Keyczar.__init__-toggle" onclick="return toggle('Keyczar.__init__');">-</a><tt class="py-line">  <tt class="py-keyword">def</tt> <a class="py-def-name" href="keyczar.keyczar.Keyczar-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">reader</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Keyczar.__init__-collapsed" style="display:none;" pad="+++" indent="++++++"></div><div id="Keyczar.__init__-expanded"><a name="L43"></a><tt class="py-lineno"> 43</tt>  <tt class="py-line">    <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">metadata</tt> <tt class="py-op">=</tt> <tt id="link-11" class="py-name"><a title="keyczar.keydata" class="py-name" href="#" onclick="return doclink('link-11', 'keydata', 'link-2');">keydata</a></tt><tt class="py-op">.</tt><tt id="link-12" class="py-name" targets="Class keyczar.keydata.KeyMetadata=keyczar.keydata.KeyMetadata-class.html"><a title="keyczar.keydata.KeyMetadata" class="py-name" href="#" onclick="return doclink('link-12', 'KeyMetadata', 'link-12');">KeyMetadata</a></tt><tt class="py-op">.</tt><tt id="link-13" class="py-name" targets="Static Method keyczar.keyczar.Crypter.Read()=keyczar.keyczar.Crypter-class.html#Read,Static Method keyczar.keyczar.Encrypter.Read()=keyczar.keyczar.Encrypter-class.html#Read,Static Method keyczar.keyczar.GenericKeyczar.Read()=keyczar.keyczar.GenericKeyczar-class.html#Read,Static Method keyczar.keyczar.Keyczar.Read()=keyczar.keyczar.Keyczar-class.html#Read,Static Method keyczar.keyczar.Signer.Read()=keyczar.keyczar.Signer-class.html#Read,Static Method keyczar.keyczar.Verifier.Read()=keyczar.keyczar.Verifier-class.html#Read,Static Method keyczar.keydata.KeyMetadata.Read()=keyczar.keydata.KeyMetadata-class.html#Read,Static Method keyczar.keydata.KeyVersion.Read()=keyczar.keydata.KeyVersion-class.html#Read,Static Method keyczar.keys.AesKey.Read()=keyczar.keys.AesKey-class.html#Read,Static Method keyczar.keys.DsaPrivateKey.Read()=keyczar.keys.DsaPrivateKey-class.html#Read,Static Method keyczar.keys.DsaPublicKey.Read()=keyczar.keys.DsaPublicKey-class.html#Read,Static Method keyczar.keys.HmacKey.Read()=keyczar.keys.HmacKey-class.html#Read,Static Method keyczar.keys.RsaPrivateKey.Read()=keyczar.keys.RsaPrivateKey-class.html#Read,Static Method keyczar.keys.RsaPublicKey.Read()=keyczar.keys.RsaPublicKey-class.html#Read"><a title="keyczar.keyczar.Crypter.Read
keyczar.keyczar.Encrypter.Read
keyczar.keyczar.GenericKeyczar.Read
keyczar.keyczar.Keyczar.Read
keyczar.keyczar.Signer.Read
keyczar.keyczar.Verifier.Read
keyczar.keydata.KeyMetadata.Read
keyczar.keydata.KeyVersion.Read
keyczar.keys.AesKey.Read
keyczar.keys.DsaPrivateKey.Read
keyczar.keys.DsaPublicKey.Read
keyczar.keys.HmacKey.Read
keyczar.keys.RsaPrivateKey.Read
keyczar.keys.RsaPublicKey.Read" class="py-name" href="#" onclick="return doclink('link-13', 'Read', 'link-13');">Read</a></tt><tt class="py-op">(</tt><tt class="py-name">reader</tt><tt class="py-op">.</tt><tt id="link-14" class="py-name" targets="Method keyczar.readers.EncryptedReader.GetMetadata()=keyczar.readers.EncryptedReader-class.html#GetMetadata,Method keyczar.readers.FileReader.GetMetadata()=keyczar.readers.FileReader-class.html#GetMetadata,Method keyczar.readers.Reader.GetMetadata()=keyczar.readers.Reader-class.html#GetMetadata"><a title="keyczar.readers.EncryptedReader.GetMetadata
keyczar.readers.FileReader.GetMetadata
keyczar.readers.Reader.GetMetadata" class="py-name" href="#" onclick="return doclink('link-14', 'GetMetadata', 'link-14');">GetMetadata</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L44"></a><tt class="py-lineno"> 44</tt>  <tt class="py-line">    <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_keys</tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-op">}</tt>  <tt class="py-comment"># maps both KeyVersions and hash ids to keys</tt> </tt>
<a name="L45"></a><tt class="py-lineno"> 45</tt>  <tt class="py-line">    <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">primary_version</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt>  <tt class="py-comment"># default if no primary key</tt> </tt>
<a name="L46"></a><tt class="py-lineno"> 46</tt>  <tt class="py-line">    <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">default_size</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">metadata</tt><tt class="py-op">.</tt><tt class="py-name">type</tt><tt class="py-op">.</tt><tt class="py-name">default_size</tt> </tt>
<a name="L47"></a><tt class="py-lineno"> 47</tt>  <tt class="py-line">     </tt>
<a name="L48"></a><tt class="py-lineno"> 48</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-15" class="py-name" targets="Method keyczar.keyczar.Crypter.IsAcceptablePurpose()=keyczar.keyczar.Crypter-class.html#IsAcceptablePurpose,Method keyczar.keyczar.Encrypter.IsAcceptablePurpose()=keyczar.keyczar.Encrypter-class.html#IsAcceptablePurpose,Method keyczar.keyczar.GenericKeyczar.IsAcceptablePurpose()=keyczar.keyczar.GenericKeyczar-class.html#IsAcceptablePurpose,Method keyczar.keyczar.Keyczar.IsAcceptablePurpose()=keyczar.keyczar.Keyczar-class.html#IsAcceptablePurpose,Method keyczar.keyczar.Signer.IsAcceptablePurpose()=keyczar.keyczar.Signer-class.html#IsAcceptablePurpose,Method keyczar.keyczar.Verifier.IsAcceptablePurpose()=keyczar.keyczar.Verifier-class.html#IsAcceptablePurpose"><a title="keyczar.keyczar.Crypter.IsAcceptablePurpose
keyczar.keyczar.Encrypter.IsAcceptablePurpose
keyczar.keyczar.GenericKeyczar.IsAcceptablePurpose
keyczar.keyczar.Keyczar.IsAcceptablePurpose
keyczar.keyczar.Signer.IsAcceptablePurpose
keyczar.keyczar.Verifier.IsAcceptablePurpose" class="py-name" href="#" onclick="return doclink('link-15', 'IsAcceptablePurpose', 'link-15');">IsAcceptablePurpose</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">metadata</tt><tt class="py-op">.</tt><tt class="py-name">purpose</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L49"></a><tt class="py-lineno"> 49</tt>  <tt class="py-line">      <tt class="py-keyword">raise</tt> <tt id="link-16" class="py-name"><a title="keyczar.errors" class="py-name" href="#" onclick="return doclink('link-16', 'errors', 'link-1');">errors</a></tt><tt class="py-op">.</tt><tt id="link-17" class="py-name" targets="Class keyczar.errors.KeyczarError=keyczar.errors.KeyczarError-class.html"><a title="keyczar.errors.KeyczarError" class="py-name" href="#" onclick="return doclink('link-17', 'KeyczarError', 'link-17');">KeyczarError</a></tt><tt class="py-op">(</tt><tt class="py-string">"Unacceptable purpose: %s"</tt>  </tt>
<a name="L50"></a><tt class="py-lineno"> 50</tt>  <tt class="py-line">                                <tt class="py-op">%</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">metadata</tt><tt class="py-op">.</tt><tt class="py-name">purpose</tt><tt class="py-op">)</tt> </tt>
<a name="L51"></a><tt class="py-lineno"> 51</tt>  <tt class="py-line">     </tt>
<a name="L52"></a><tt class="py-lineno"> 52</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">metadata</tt><tt class="py-op">.</tt><tt class="py-name">encrypted</tt> <tt class="py-keyword">and</tt> <tt class="py-keyword">not</tt> <tt class="py-name">isinstance</tt><tt class="py-op">(</tt><tt class="py-name">reader</tt><tt class="py-op">,</tt>  </tt>
<a name="L53"></a><tt class="py-lineno"> 53</tt>  <tt class="py-line">                                                  <tt id="link-18" class="py-name"><a title="keyczar.readers" class="py-name" href="#" onclick="return doclink('link-18', 'readers', 'link-5');">readers</a></tt><tt class="py-op">.</tt><tt id="link-19" class="py-name" targets="Class keyczar.readers.EncryptedReader=keyczar.readers.EncryptedReader-class.html"><a title="keyczar.readers.EncryptedReader" class="py-name" href="#" onclick="return doclink('link-19', 'EncryptedReader', 'link-19');">EncryptedReader</a></tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L54"></a><tt class="py-lineno"> 54</tt>  <tt class="py-line">      <tt class="py-keyword">raise</tt> <tt id="link-20" class="py-name"><a title="keyczar.errors" class="py-name" href="#" onclick="return doclink('link-20', 'errors', 'link-1');">errors</a></tt><tt class="py-op">.</tt><tt id="link-21" class="py-name"><a title="keyczar.errors.KeyczarError" class="py-name" href="#" onclick="return doclink('link-21', 'KeyczarError', 'link-17');">KeyczarError</a></tt><tt class="py-op">(</tt><tt class="py-string">"Need encrypted reader."</tt><tt class="py-op">)</tt> </tt>
<a name="L55"></a><tt class="py-lineno"> 55</tt>  <tt class="py-line">       </tt>
<a name="L56"></a><tt class="py-lineno"> 56</tt>  <tt class="py-line">    <tt class="py-keyword">for</tt> <tt class="py-name">version</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">metadata</tt><tt class="py-op">.</tt><tt id="link-22" class="py-name" targets="Variable keyczar.keyczar.Keyczar.versions=keyczar.keyczar.Keyczar-class.html#versions,Variable keyczar.keydata.KeyMetadata.versions=keyczar.keydata.KeyMetadata-class.html#versions"><a title="keyczar.keyczar.Keyczar.versions
keyczar.keydata.KeyMetadata.versions" class="py-name" href="#" onclick="return doclink('link-22', 'versions', 'link-22');">versions</a></tt><tt class="py-op">:</tt> </tt>
<a name="L57"></a><tt class="py-lineno"> 57</tt>  <tt class="py-line">      <tt class="py-keyword">if</tt> <tt class="py-name">version</tt><tt class="py-op">.</tt><tt id="link-23" class="py-name" targets="Variable keyczar.keydata.KeyVersion.status=keyczar.keydata.KeyVersion-class.html#status"><a title="keyczar.keydata.KeyVersion.status" class="py-name" href="#" onclick="return doclink('link-23', 'status', 'link-23');">status</a></tt> <tt class="py-op">==</tt> <tt id="link-24" class="py-name"><a title="keyczar.keyinfo" class="py-name" href="#" onclick="return doclink('link-24', 'keyinfo', 'link-3');">keyinfo</a></tt><tt class="py-op">.</tt><tt id="link-25" class="py-name" targets="Variable keyczar.keyinfo.PRIMARY=keyczar.keyinfo-module.html#PRIMARY"><a title="keyczar.keyinfo.PRIMARY" class="py-name" href="#" onclick="return doclink('link-25', 'PRIMARY', 'link-25');">PRIMARY</a></tt><tt class="py-op">:</tt> </tt>
<a name="L58"></a><tt class="py-lineno"> 58</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">primary_version</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L59"></a><tt class="py-lineno"> 59</tt>  <tt class="py-line">          <tt class="py-keyword">raise</tt> <tt id="link-26" class="py-name"><a title="keyczar.errors" class="py-name" href="#" onclick="return doclink('link-26', 'errors', 'link-1');">errors</a></tt><tt class="py-op">.</tt><tt id="link-27" class="py-name"><a title="keyczar.errors.KeyczarError" class="py-name" href="#" onclick="return doclink('link-27', 'KeyczarError', 'link-17');">KeyczarError</a></tt><tt class="py-op">(</tt> </tt>
<a name="L60"></a><tt class="py-lineno"> 60</tt>  <tt class="py-line">              <tt class="py-string">"Key sets may only have a single primary version"</tt><tt class="py-op">)</tt> </tt>
<a name="L61"></a><tt class="py-lineno"> 61</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">primary_version</tt> <tt class="py-op">=</tt> <tt class="py-name">version</tt> </tt>
<a name="L62"></a><tt class="py-lineno"> 62</tt>  <tt class="py-line">      <tt class="py-name">key</tt> <tt class="py-op">=</tt> <tt id="link-28" class="py-name"><a title="keyczar.keys" class="py-name" href="#" onclick="return doclink('link-28', 'keys', 'link-4');">keys</a></tt><tt class="py-op">.</tt><tt id="link-29" class="py-name" targets="Function keyczar.keys.ReadKey()=keyczar.keys-module.html#ReadKey"><a title="keyczar.keys.ReadKey" class="py-name" href="#" onclick="return doclink('link-29', 'ReadKey', 'link-29');">ReadKey</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">metadata</tt><tt class="py-op">.</tt><tt class="py-name">type</tt><tt class="py-op">,</tt>  </tt>
<a name="L63"></a><tt class="py-lineno"> 63</tt>  <tt class="py-line">                         <tt class="py-name">reader</tt><tt class="py-op">.</tt><tt id="link-30" class="py-name" targets="Method keyczar.keyczar.Keyczar.GetKey()=keyczar.keyczar.Keyczar-class.html#GetKey,Method keyczar.readers.EncryptedReader.GetKey()=keyczar.readers.EncryptedReader-class.html#GetKey,Method keyczar.readers.FileReader.GetKey()=keyczar.readers.FileReader-class.html#GetKey,Method keyczar.readers.Reader.GetKey()=keyczar.readers.Reader-class.html#GetKey"><a title="keyczar.keyczar.Keyczar.GetKey
keyczar.readers.EncryptedReader.GetKey
keyczar.readers.FileReader.GetKey
keyczar.readers.Reader.GetKey" class="py-name" href="#" onclick="return doclink('link-30', 'GetKey', 'link-30');">GetKey</a></tt><tt class="py-op">(</tt><tt class="py-name">version</tt><tt class="py-op">.</tt><tt class="py-name">version_number</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L64"></a><tt class="py-lineno"> 64</tt>  <tt class="py-line">      <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_keys</tt><tt class="py-op">[</tt><tt class="py-name">version</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">key</tt> </tt>
<a name="L65"></a><tt class="py-lineno"> 65</tt>  <tt class="py-line">      <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_keys</tt><tt class="py-op">[</tt><tt class="py-name">key</tt><tt class="py-op">.</tt><tt id="link-31" class="py-name" targets="Variable keyczar.keys.Key.hash=keyczar.keys.Key-class.html#hash"><a title="keyczar.keys.Key.hash" class="py-name" href="#" onclick="return doclink('link-31', 'hash', 'link-31');">hash</a></tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">key</tt> </tt>
</div><a name="L66"></a><tt class="py-lineno"> 66</tt>  <tt class="py-line">     </tt>
<a name="L67"></a><tt class="py-lineno"> 67</tt>  <tt class="py-line">  <tt id="link-32" class="py-name"><a title="keyczar.keyczar.Keyczar.versions
keyczar.keydata.KeyMetadata.versions" class="py-name" href="#" onclick="return doclink('link-32', 'versions', 'link-22');">versions</a></tt> <tt class="py-op">=</tt> <tt class="py-name">property</tt><tt class="py-op">(</tt><tt class="py-keyword">lambda</tt> <tt class="py-name">self</tt><tt class="py-op">:</tt> <tt class="py-op">[</tt><tt class="py-name">k</tt> <tt class="py-keyword">for</tt> <tt class="py-name">k</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_keys</tt><tt class="py-op">.</tt><tt id="link-33" class="py-name"><a title="keyczar.keys" class="py-name" href="#" onclick="return doclink('link-33', 'keys', 'link-4');">keys</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt>  </tt>
<a name="L68"></a><tt class="py-lineno"> 68</tt>  <tt class="py-line">                                    <tt class="py-keyword">if</tt> <tt class="py-name">isinstance</tt><tt class="py-op">(</tt><tt class="py-name">k</tt><tt class="py-op">,</tt> <tt id="link-34" class="py-name"><a title="keyczar.keydata" class="py-name" href="#" onclick="return doclink('link-34', 'keydata', 'link-2');">keydata</a></tt><tt class="py-op">.</tt><tt id="link-35" class="py-name" targets="Class keyczar.keydata.KeyVersion=keyczar.keydata.KeyVersion-class.html"><a title="keyczar.keydata.KeyVersion" class="py-name" href="#" onclick="return doclink('link-35', 'KeyVersion', 'link-35');">KeyVersion</a></tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
<a name="L69"></a><tt class="py-lineno"> 69</tt>  <tt class="py-line">                      <tt class="py-name">doc</tt><tt class="py-op">=</tt><tt class="py-string">"""List of versions in key set."""</tt><tt class="py-op">)</tt> </tt>
<a name="L70"></a><tt class="py-lineno"> 70</tt>  <tt class="py-line">  <tt id="link-36" class="py-name" targets="Variable keyczar.keyczar.Keyczar.primary_key=keyczar.keyczar.Keyczar-class.html#primary_key"><a title="keyczar.keyczar.Keyczar.primary_key" class="py-name" href="#" onclick="return doclink('link-36', 'primary_key', 'link-36');">primary_key</a></tt> <tt class="py-op">=</tt> <tt class="py-name">property</tt><tt class="py-op">(</tt><tt class="py-keyword">lambda</tt> <tt class="py-name">self</tt><tt class="py-op">:</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-37" class="py-name"><a title="keyczar.keyczar.Keyczar.GetKey
keyczar.readers.EncryptedReader.GetKey
keyczar.readers.FileReader.GetKey
keyczar.readers.Reader.GetKey" class="py-name" href="#" onclick="return doclink('link-37', 'GetKey', 'link-30');">GetKey</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">primary_version</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L71"></a><tt class="py-lineno"> 71</tt>  <tt class="py-line">                         <tt class="py-name">doc</tt><tt class="py-op">=</tt><tt class="py-string">"""The primary key for this key set."""</tt><tt class="py-op">)</tt> </tt>
<a name="L72"></a><tt class="py-lineno"> 72</tt>  <tt class="py-line">   </tt>
<a name="Keyczar.__str__"></a><div id="Keyczar.__str__-def"><a name="L73"></a><tt class="py-lineno"> 73</tt> <a class="py-toggle" href="#" id="Keyczar.__str__-toggle" onclick="return toggle('Keyczar.__str__');">-</a><tt class="py-line">  <tt class="py-keyword">def</tt> <a class="py-def-name" href="keyczar.keyczar.Keyczar-class.html#__str__">__str__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Keyczar.__str__-collapsed" style="display:none;" pad="+++" indent="++++++"></div><div id="Keyczar.__str__-expanded"><a name="L74"></a><tt class="py-lineno"> 74</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">metadata</tt><tt class="py-op">)</tt> </tt>
</div><a name="L75"></a><tt class="py-lineno"> 75</tt>  <tt class="py-line">   </tt>
<a name="Keyczar._ParseHeader"></a><div id="Keyczar._ParseHeader-def"><a name="L76"></a><tt class="py-lineno"> 76</tt> <a class="py-toggle" href="#" id="Keyczar._ParseHeader-toggle" onclick="return toggle('Keyczar._ParseHeader');">-</a><tt class="py-line">  <tt class="py-keyword">def</tt> <a class="py-def-name" href="keyczar.keyczar.Keyczar-class.html#_ParseHeader">_ParseHeader</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">header</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Keyczar._ParseHeader-collapsed" style="display:none;" pad="+++" indent="++++++"></div><div id="Keyczar._ParseHeader-expanded"><a name="L77"></a><tt class="py-lineno"> 77</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L78"></a><tt class="py-lineno"> 78</tt>  <tt class="py-line"><tt class="py-docstring">    Parse the header and verify version, format info. Return key if exists.</tt> </tt>
<a name="L79"></a><tt class="py-lineno"> 79</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L80"></a><tt class="py-lineno"> 80</tt>  <tt class="py-line"><tt class="py-docstring">    @param header: the bytes of the header of Keyczar output</tt> </tt>
<a name="L81"></a><tt class="py-lineno"> 81</tt>  <tt class="py-line"><tt class="py-docstring">    @type header: string</tt> </tt>
<a name="L82"></a><tt class="py-lineno"> 82</tt>  <tt class="py-line"><tt class="py-docstring">      </tt> </tt>
<a name="L83"></a><tt class="py-lineno"> 83</tt>  <tt class="py-line"><tt class="py-docstring">    @return: the key identified by the hash in the header</tt> </tt>
<a name="L84"></a><tt class="py-lineno"> 84</tt>  <tt class="py-line"><tt class="py-docstring">    @rtype: L{keys.Key}</tt> </tt>
<a name="L85"></a><tt class="py-lineno"> 85</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L86"></a><tt class="py-lineno"> 86</tt>  <tt class="py-line"><tt class="py-docstring">    @raise BadVersionError: if header specifies an illegal version</tt> </tt>
<a name="L87"></a><tt class="py-lineno"> 87</tt>  <tt class="py-line"><tt class="py-docstring">    @raise KeyNotFoundError: if key specified in header doesn't exist</tt> </tt>
<a name="L88"></a><tt class="py-lineno"> 88</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L89"></a><tt class="py-lineno"> 89</tt>  <tt class="py-line">    <tt class="py-name">version</tt> <tt class="py-op">=</tt> <tt class="py-name">ord</tt><tt class="py-op">(</tt><tt class="py-name">header</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L90"></a><tt class="py-lineno"> 90</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">version</tt> <tt class="py-op">!=</tt> <tt id="link-38" class="py-name"><a title="keyczar.keyczar.VERSION
keyczar.keyczart.VERSION" class="py-name" href="#" onclick="return doclink('link-38', 'VERSION', 'link-7');">VERSION</a></tt><tt class="py-op">:</tt> </tt>
<a name="L91"></a><tt class="py-lineno"> 91</tt>  <tt class="py-line">      <tt class="py-keyword">raise</tt> <tt id="link-39" class="py-name"><a title="keyczar.errors" class="py-name" href="#" onclick="return doclink('link-39', 'errors', 'link-1');">errors</a></tt><tt class="py-op">.</tt><tt id="link-40" class="py-name" targets="Class keyczar.errors.BadVersionError=keyczar.errors.BadVersionError-class.html"><a title="keyczar.errors.BadVersionError" class="py-name" href="#" onclick="return doclink('link-40', 'BadVersionError', 'link-40');">BadVersionError</a></tt><tt class="py-op">(</tt><tt class="py-name">version</tt><tt class="py-op">)</tt> </tt>
<a name="L92"></a><tt class="py-lineno"> 92</tt>  <tt class="py-line">    <tt id="link-41" class="py-name"><a title="keyczar.keys.Key.hash" class="py-name" href="#" onclick="return doclink('link-41', 'hash', 'link-31');">hash</a></tt> <tt class="py-op">=</tt> <tt id="link-42" class="py-name"><a title="keyczar.util" class="py-name" href="#" onclick="return doclink('link-42', 'util', 'link-6');">util</a></tt><tt class="py-op">.</tt><tt id="link-43" class="py-name" targets="Function keyczar.util.Encode()=keyczar.util-module.html#Encode"><a title="keyczar.util.Encode" class="py-name" href="#" onclick="return doclink('link-43', 'Encode', 'link-43');">Encode</a></tt><tt class="py-op">(</tt><tt class="py-name">header</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">:</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L93"></a><tt class="py-lineno"> 93</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-44" class="py-name"><a title="keyczar.keyczar.Keyczar.GetKey
keyczar.readers.EncryptedReader.GetKey
keyczar.readers.FileReader.GetKey
keyczar.readers.Reader.GetKey" class="py-name" href="#" onclick="return doclink('link-44', 'GetKey', 'link-30');">GetKey</a></tt><tt class="py-op">(</tt><tt id="link-45" class="py-name"><a title="keyczar.keys.Key.hash" class="py-name" href="#" onclick="return doclink('link-45', 'hash', 'link-31');">hash</a></tt><tt class="py-op">)</tt> </tt>
</div><a name="L94"></a><tt class="py-lineno"> 94</tt>  <tt class="py-line">   </tt>
<a name="L95"></a><tt class="py-lineno"> 95</tt>  <tt class="py-line">  <tt class="py-decorator">@</tt><tt class="py-decorator">staticmethod</tt> </tt>
<a name="Keyczar.Read"></a><div id="Keyczar.Read-def"><a name="L96"></a><tt class="py-lineno"> 96</tt> <a class="py-toggle" href="#" id="Keyczar.Read-toggle" onclick="return toggle('Keyczar.Read');">-</a><tt class="py-line">  <tt class="py-keyword">def</tt> <a class="py-def-name" href="keyczar.keyczar.Keyczar-class.html#Read">Read</a><tt class="py-op">(</tt><tt class="py-param">location</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Keyczar.Read-collapsed" style="display:none;" pad="+++" indent="++++++"></div><div id="Keyczar.Read-expanded"><a name="L97"></a><tt class="py-lineno"> 97</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L98"></a><tt class="py-lineno"> 98</tt>  <tt class="py-line"><tt class="py-docstring">    Return a Keyczar object created from FileReader at given location.</tt> </tt>
<a name="L99"></a><tt class="py-lineno"> 99</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L100"></a><tt class="py-lineno">100</tt>  <tt class="py-line"><tt class="py-docstring">    @param location: pathname of the directory storing the key files</tt> </tt>
<a name="L101"></a><tt class="py-lineno">101</tt>  <tt class="py-line"><tt class="py-docstring">    @type location: string</tt> </tt>
<a name="L102"></a><tt class="py-lineno">102</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L103"></a><tt class="py-lineno">103</tt>  <tt class="py-line"><tt class="py-docstring">    @return: a Keyczar to manage the keys stored at the given location</tt> </tt>
<a name="L104"></a><tt class="py-lineno">104</tt>  <tt class="py-line"><tt class="py-docstring">    @rtype: L{Keyczar}</tt> </tt>
<a name="L105"></a><tt class="py-lineno">105</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L106"></a><tt class="py-lineno">106</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt id="link-46" class="py-name" targets="Class keyczar.keyczar.Keyczar=keyczar.keyczar.Keyczar-class.html"><a title="keyczar.keyczar.Keyczar" class="py-name" href="#" onclick="return doclink('link-46', 'Keyczar', 'link-46');">Keyczar</a></tt><tt class="py-op">(</tt><tt id="link-47" class="py-name"><a title="keyczar.readers" class="py-name" href="#" onclick="return doclink('link-47', 'readers', 'link-5');">readers</a></tt><tt class="py-op">.</tt><tt id="link-48" class="py-name" targets="Class keyczar.readers.FileReader=keyczar.readers.FileReader-class.html"><a title="keyczar.readers.FileReader" class="py-name" href="#" onclick="return doclink('link-48', 'FileReader', 'link-48');">FileReader</a></tt><tt class="py-op">(</tt><tt class="py-name">location</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="L107"></a><tt class="py-lineno">107</tt>  <tt class="py-line">   </tt>
<a name="Keyczar.IsAcceptablePurpose"></a><div id="Keyczar.IsAcceptablePurpose-def"><a name="L108"></a><tt class="py-lineno">108</tt> <a class="py-toggle" href="#" id="Keyczar.IsAcceptablePurpose-toggle" onclick="return toggle('Keyczar.IsAcceptablePurpose');">-</a><tt class="py-line">  <tt class="py-keyword">def</tt> <a class="py-def-name" href="keyczar.keyczar.Keyczar-class.html#IsAcceptablePurpose">IsAcceptablePurpose</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">purpose</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Keyczar.IsAcceptablePurpose-collapsed" style="display:none;" pad="+++" indent="++++++"></div><div id="Keyczar.IsAcceptablePurpose-expanded"><a name="L109"></a><tt class="py-lineno">109</tt>  <tt class="py-line">    <tt class="py-docstring">"""Indicates whether purpose is valid. Abstract method."""</tt> </tt>
</div><a name="L110"></a><tt class="py-lineno">110</tt>  <tt class="py-line">   </tt>
<a name="Keyczar.GetKey"></a><div id="Keyczar.GetKey-def"><a name="L111"></a><tt class="py-lineno">111</tt> <a class="py-toggle" href="#" id="Keyczar.GetKey-toggle" onclick="return toggle('Keyczar.GetKey');">-</a><tt class="py-line">  <tt class="py-keyword">def</tt> <a class="py-def-name" href="keyczar.keyczar.Keyczar-class.html#GetKey">GetKey</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">id</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Keyczar.GetKey-collapsed" style="display:none;" pad="+++" indent="++++++"></div><div id="Keyczar.GetKey-expanded"><a name="L112"></a><tt class="py-lineno">112</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L113"></a><tt class="py-lineno">113</tt>  <tt class="py-line"><tt class="py-docstring">    Returns the key associated with the given id, a hash or a version.</tt> </tt>
<a name="L114"></a><tt class="py-lineno">114</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L115"></a><tt class="py-lineno">115</tt>  <tt class="py-line"><tt class="py-docstring">    @param id: Either the hash identifier of the key or its version.</tt> </tt>
<a name="L116"></a><tt class="py-lineno">116</tt>  <tt class="py-line"><tt class="py-docstring">    @type id: string or L{keydata.KeyVersion}</tt> </tt>
<a name="L117"></a><tt class="py-lineno">117</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L118"></a><tt class="py-lineno">118</tt>  <tt class="py-line"><tt class="py-docstring">    @return: key associated with this id or None if id doesn't exist.</tt> </tt>
<a name="L119"></a><tt class="py-lineno">119</tt>  <tt class="py-line"><tt class="py-docstring">    @rtype: L{keys.Key}</tt> </tt>
<a name="L120"></a><tt class="py-lineno">120</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L121"></a><tt class="py-lineno">121</tt>  <tt class="py-line"><tt class="py-docstring">    @raise KeyNotFoundError: if key with given id doesn't exist</tt> </tt>
<a name="L122"></a><tt class="py-lineno">122</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L123"></a><tt class="py-lineno">123</tt>  <tt class="py-line">    <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L124"></a><tt class="py-lineno">124</tt>  <tt class="py-line">      <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_keys</tt><tt class="py-op">[</tt><tt class="py-name">id</tt><tt class="py-op">]</tt> </tt>
<a name="L125"></a><tt class="py-lineno">125</tt>  <tt class="py-line">    <tt class="py-keyword">except</tt> <tt class="py-name">KeyError</tt><tt class="py-op">:</tt> </tt>
<a name="L126"></a><tt class="py-lineno">126</tt>  <tt class="py-line">      <tt class="py-keyword">raise</tt> <tt id="link-49" class="py-name"><a title="keyczar.errors" class="py-name" href="#" onclick="return doclink('link-49', 'errors', 'link-1');">errors</a></tt><tt class="py-op">.</tt><tt id="link-50" class="py-name" targets="Class keyczar.errors.KeyNotFoundError=keyczar.errors.KeyNotFoundError-class.html"><a title="keyczar.errors.KeyNotFoundError" class="py-name" href="#" onclick="return doclink('link-50', 'KeyNotFoundError', 'link-50');">KeyNotFoundError</a></tt><tt class="py-op">(</tt><tt class="py-name">id</tt><tt class="py-op">)</tt> </tt>
</div><a name="L127"></a><tt class="py-lineno">127</tt>  <tt class="py-line">   </tt>
<a name="Keyczar._AddKey"></a><div id="Keyczar._AddKey-def"><a name="L128"></a><tt class="py-lineno">128</tt> <a class="py-toggle" href="#" id="Keyczar._AddKey-toggle" onclick="return toggle('Keyczar._AddKey');">-</a><tt class="py-line">  <tt class="py-keyword">def</tt> <a class="py-def-name" href="keyczar.keyczar.Keyczar-class.html#_AddKey">_AddKey</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">version</tt><tt class="py-op">,</tt> <tt class="py-param">key</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Keyczar._AddKey-collapsed" style="display:none;" pad="+++" indent="++++++"></div><div id="Keyczar._AddKey-expanded"><a name="L129"></a><tt class="py-lineno">129</tt>  <tt class="py-line">    <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_keys</tt><tt class="py-op">[</tt><tt class="py-name">version</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_keys</tt><tt class="py-op">[</tt><tt class="py-name">key</tt><tt class="py-op">.</tt><tt id="link-51" class="py-name"><a title="keyczar.keys.Key.hash" class="py-name" href="#" onclick="return doclink('link-51', 'hash', 'link-31');">hash</a></tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">key</tt> </tt>
<a name="L130"></a><tt class="py-lineno">130</tt>  <tt class="py-line">    <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">metadata</tt><tt class="py-op">.</tt><tt id="link-52" class="py-name" targets="Method keyczar.keyczar.GenericKeyczar.AddVersion()=keyczar.keyczar.GenericKeyczar-class.html#AddVersion,Method keyczar.keydata.KeyMetadata.AddVersion()=keyczar.keydata.KeyMetadata-class.html#AddVersion"><a title="keyczar.keyczar.GenericKeyczar.AddVersion
keyczar.keydata.KeyMetadata.AddVersion" class="py-name" href="#" onclick="return doclink('link-52', 'AddVersion', 'link-52');">AddVersion</a></tt><tt class="py-op">(</tt><tt class="py-name">version</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L131"></a><tt class="py-lineno">131</tt>  <tt class="py-line"> </tt>
<a name="GenericKeyczar"></a><div id="GenericKeyczar-def"><a name="L132"></a><tt class="py-lineno">132</tt> <a class="py-toggle" href="#" id="GenericKeyczar-toggle" onclick="return toggle('GenericKeyczar');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="keyczar.keyczar.GenericKeyczar-class.html">GenericKeyczar</a><tt class="py-op">(</tt><tt class="py-base-class">Keyczar</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="GenericKeyczar-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="GenericKeyczar-expanded"><a name="L133"></a><tt class="py-lineno">133</tt>  <tt class="py-line">   </tt>
<a name="L134"></a><tt class="py-lineno">134</tt>  <tt class="py-line">  <tt class="py-docstring">"""To be used by Keyczart."""</tt> </tt>
<a name="L135"></a><tt class="py-lineno">135</tt>  <tt class="py-line">   </tt>
<a name="L136"></a><tt class="py-lineno">136</tt>  <tt class="py-line">  <tt class="py-decorator">@</tt><tt class="py-decorator">staticmethod</tt> </tt>
<a name="GenericKeyczar.Read"></a><div id="GenericKeyczar.Read-def"><a name="L137"></a><tt class="py-lineno">137</tt> <a class="py-toggle" href="#" id="GenericKeyczar.Read-toggle" onclick="return toggle('GenericKeyczar.Read');">-</a><tt class="py-line">  <tt class="py-keyword">def</tt> <a class="py-def-name" href="keyczar.keyczar.GenericKeyczar-class.html#Read">Read</a><tt class="py-op">(</tt><tt class="py-param">location</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="GenericKeyczar.Read-collapsed" style="display:none;" pad="+++" indent="++++++"></div><div id="GenericKeyczar.Read-expanded"><a name="L138"></a><tt class="py-lineno">138</tt>  <tt class="py-line">    <tt class="py-docstring">"""Return a GenericKeyczar created from FileReader at given location."""</tt> </tt>
<a name="L139"></a><tt class="py-lineno">139</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt id="link-53" class="py-name" targets="Class keyczar.keyczar.GenericKeyczar=keyczar.keyczar.GenericKeyczar-class.html"><a title="keyczar.keyczar.GenericKeyczar" class="py-name" href="#" onclick="return doclink('link-53', 'GenericKeyczar', 'link-53');">GenericKeyczar</a></tt><tt class="py-op">(</tt><tt id="link-54" class="py-name"><a title="keyczar.readers" class="py-name" href="#" onclick="return doclink('link-54', 'readers', 'link-5');">readers</a></tt><tt class="py-op">.</tt><tt id="link-55" class="py-name"><a title="keyczar.readers.FileReader" class="py-name" href="#" onclick="return doclink('link-55', 'FileReader', 'link-48');">FileReader</a></tt><tt class="py-op">(</tt><tt class="py-name">location</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="L140"></a><tt class="py-lineno">140</tt>  <tt class="py-line"> </tt>
<a name="GenericKeyczar.IsAcceptablePurpose"></a><div id="GenericKeyczar.IsAcceptablePurpose-def"><a name="L141"></a><tt class="py-lineno">141</tt> <a class="py-toggle" href="#" id="GenericKeyczar.IsAcceptablePurpose-toggle" onclick="return toggle('GenericKeyczar.IsAcceptablePurpose');">-</a><tt class="py-line">  <tt class="py-keyword">def</tt> <a class="py-def-name" href="keyczar.keyczar.GenericKeyczar-class.html#IsAcceptablePurpose">IsAcceptablePurpose</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">purpose</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="GenericKeyczar.IsAcceptablePurpose-collapsed" style="display:none;" pad="+++" indent="++++++"></div><div id="GenericKeyczar.IsAcceptablePurpose-expanded"><a name="L142"></a><tt class="py-lineno">142</tt>  <tt class="py-line">    <tt class="py-docstring">"""All purposes ok for Keyczart."""</tt> </tt>
<a name="L143"></a><tt class="py-lineno">143</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">True</tt> </tt>
</div><a name="L144"></a><tt class="py-lineno">144</tt>  <tt class="py-line">   </tt>
<a name="GenericKeyczar.AddVersion"></a><div id="GenericKeyczar.AddVersion-def"><a name="L145"></a><tt class="py-lineno">145</tt> <a class="py-toggle" href="#" id="GenericKeyczar.AddVersion-toggle" onclick="return toggle('GenericKeyczar.AddVersion');">-</a><tt class="py-line">  <tt class="py-keyword">def</tt> <a class="py-def-name" href="keyczar.keyczar.GenericKeyczar-class.html#AddVersion">AddVersion</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">status</tt><tt class="py-op">,</tt> <tt class="py-param">size</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="GenericKeyczar.AddVersion-collapsed" style="display:none;" pad="+++" indent="++++++"></div><div id="GenericKeyczar.AddVersion-expanded"><a name="L146"></a><tt class="py-lineno">146</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L147"></a><tt class="py-lineno">147</tt>  <tt class="py-line"><tt class="py-docstring">    Adds a new key version with given status to key set.</tt> </tt>
<a name="L148"></a><tt class="py-lineno">148</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L149"></a><tt class="py-lineno">149</tt>  <tt class="py-line"><tt class="py-docstring">    Generates a new key of same type (repeated until hash identifier is unique) </tt> </tt>
<a name="L150"></a><tt class="py-lineno">150</tt>  <tt class="py-line"><tt class="py-docstring">    for this version. Uses supplied key size (if provided) in lieu of the</tt> </tt>
<a name="L151"></a><tt class="py-lineno">151</tt>  <tt class="py-line"><tt class="py-docstring">    default key size. If this is an unacceptable key size, uses the default </tt> </tt>
<a name="L152"></a><tt class="py-lineno">152</tt>  <tt class="py-line"><tt class="py-docstring">    key size. Uses next available version number.</tt> </tt>
<a name="L153"></a><tt class="py-lineno">153</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L154"></a><tt class="py-lineno">154</tt>  <tt class="py-line"><tt class="py-docstring">    @param status: the status of the new key to be added</tt> </tt>
<a name="L155"></a><tt class="py-lineno">155</tt>  <tt class="py-line"><tt class="py-docstring">    @type status: L{keyinfo.KeyStatus}</tt> </tt>
<a name="L156"></a><tt class="py-lineno">156</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L157"></a><tt class="py-lineno">157</tt>  <tt class="py-line"><tt class="py-docstring">    @param size: size of key in bits, uses default size if not provided.</tt> </tt>
<a name="L158"></a><tt class="py-lineno">158</tt>  <tt class="py-line"><tt class="py-docstring">    @type size: integer</tt> </tt>
<a name="L159"></a><tt class="py-lineno">159</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L160"></a><tt class="py-lineno">160</tt>  <tt class="py-line"><tt class="py-docstring">    @raise KeyczarError: if key type unsupported</tt> </tt>
<a name="L161"></a><tt class="py-lineno">161</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L162"></a><tt class="py-lineno">162</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt id="link-56" class="py-name" targets="Variable keyczar.keys.Key.size=keyczar.keys.Key-class.html#size"><a title="keyczar.keys.Key.size" class="py-name" href="#" onclick="return doclink('link-56', 'size', 'link-56');">size</a></tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L163"></a><tt class="py-lineno">163</tt>  <tt class="py-line">      <tt id="link-57" class="py-name"><a title="keyczar.keys.Key.size" class="py-name" href="#" onclick="return doclink('link-57', 'size', 'link-56');">size</a></tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">default_size</tt> </tt>
<a name="L164"></a><tt class="py-lineno">164</tt>  <tt class="py-line">   </tt>
<a name="L165"></a><tt class="py-lineno">165</tt>  <tt class="py-line">    <tt class="py-name">version</tt> <tt class="py-op">=</tt> <tt id="link-58" class="py-name"><a title="keyczar.keydata" class="py-name" href="#" onclick="return doclink('link-58', 'keydata', 'link-2');">keydata</a></tt><tt class="py-op">.</tt><tt id="link-59" class="py-name"><a title="keyczar.keydata.KeyVersion" class="py-name" href="#" onclick="return doclink('link-59', 'KeyVersion', 'link-35');">KeyVersion</a></tt><tt class="py-op">(</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-60" class="py-name"><a title="keyczar.keyczar.Keyczar.versions
keyczar.keydata.KeyMetadata.versions" class="py-name" href="#" onclick="return doclink('link-60', 'versions', 'link-22');">versions</a></tt><tt class="py-op">)</tt> <tt class="py-op">+</tt> <tt class="py-number">1</tt><tt class="py-op">,</tt> <tt id="link-61" class="py-name"><a title="keyczar.keydata.KeyVersion.status" class="py-name" href="#" onclick="return doclink('link-61', 'status', 'link-23');">status</a></tt><tt class="py-op">,</tt> <tt class="py-name">False</tt><tt class="py-op">)</tt> </tt>
<a name="L166"></a><tt class="py-lineno">166</tt>  <tt class="py-line">     </tt>
<a name="L167"></a><tt class="py-lineno">167</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt id="link-62" class="py-name"><a title="keyczar.keydata.KeyVersion.status" class="py-name" href="#" onclick="return doclink('link-62', 'status', 'link-23');">status</a></tt> <tt class="py-op">==</tt> <tt id="link-63" class="py-name"><a title="keyczar.keyinfo" class="py-name" href="#" onclick="return doclink('link-63', 'keyinfo', 'link-3');">keyinfo</a></tt><tt class="py-op">.</tt><tt id="link-64" class="py-name"><a title="keyczar.keyinfo.PRIMARY" class="py-name" href="#" onclick="return doclink('link-64', 'PRIMARY', 'link-25');">PRIMARY</a></tt><tt class="py-op">:</tt> </tt>
<a name="L168"></a><tt class="py-lineno">168</tt>  <tt class="py-line">      <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">primary_version</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L169"></a><tt class="py-lineno">169</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">primary_version</tt><tt class="py-op">.</tt><tt id="link-65" class="py-name"><a title="keyczar.keydata.KeyVersion.status" class="py-name" href="#" onclick="return doclink('link-65', 'status', 'link-23');">status</a></tt> <tt class="py-op">=</tt> <tt id="link-66" class="py-name"><a title="keyczar.keyinfo" class="py-name" href="#" onclick="return doclink('link-66', 'keyinfo', 'link-3');">keyinfo</a></tt><tt class="py-op">.</tt><tt id="link-67" class="py-name" targets="Variable keyczar.keyinfo.ACTIVE=keyczar.keyinfo-module.html#ACTIVE"><a title="keyczar.keyinfo.ACTIVE" class="py-name" href="#" onclick="return doclink('link-67', 'ACTIVE', 'link-67');">ACTIVE</a></tt> </tt>
<a name="L170"></a><tt class="py-lineno">170</tt>  <tt class="py-line">      <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">primary_version</tt> <tt class="py-op">=</tt> <tt class="py-name">version</tt> </tt>
<a name="L171"></a><tt class="py-lineno">171</tt>  <tt class="py-line">     </tt>
<a name="L172"></a><tt class="py-lineno">172</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt id="link-68" class="py-name"><a title="keyczar.keys.Key.size" class="py-name" href="#" onclick="return doclink('link-68', 'size', 'link-56');">size</a></tt> <tt class="py-op">&lt;</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">default_size</tt><tt class="py-op">:</tt> </tt>
<a name="L173"></a><tt class="py-lineno">173</tt>  <tt class="py-line">      <tt class="py-keyword">print</tt><tt class="py-op">(</tt><tt class="py-string">"WARNING: %d-bit key size is less than recommended default key"</tt> <tt class="py-op">+</tt> </tt>
<a name="L174"></a><tt class="py-lineno">174</tt>  <tt class="py-line">            <tt class="py-string">"size of %d bits for %s keys."</tt> </tt>
<a name="L175"></a><tt class="py-lineno">175</tt>  <tt class="py-line">            <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt id="link-69" class="py-name"><a title="keyczar.keys.Key.size" class="py-name" href="#" onclick="return doclink('link-69', 'size', 'link-56');">size</a></tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">default_size</tt><tt class="py-op">,</tt> <tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">metadata</tt><tt class="py-op">.</tt><tt class="py-name">type</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L176"></a><tt class="py-lineno">176</tt>  <tt class="py-line">     </tt>
<a name="L177"></a><tt class="py-lineno">177</tt>  <tt class="py-line">    <tt class="py-comment"># Make sure no keys collide on their identifiers</tt> </tt>
<a name="L178"></a><tt class="py-lineno">178</tt>  <tt class="py-line"><tt class="py-comment"></tt>    <tt class="py-keyword">while</tt> <tt class="py-name">True</tt><tt class="py-op">:</tt> </tt>
<a name="L179"></a><tt class="py-lineno">179</tt>  <tt class="py-line">      <tt class="py-name">key</tt> <tt class="py-op">=</tt> <tt id="link-70" class="py-name"><a title="keyczar.keys" class="py-name" href="#" onclick="return doclink('link-70', 'keys', 'link-4');">keys</a></tt><tt class="py-op">.</tt><tt id="link-71" class="py-name" targets="Function keyczar.keys.GenKey()=keyczar.keys-module.html#GenKey"><a title="keyczar.keys.GenKey" class="py-name" href="#" onclick="return doclink('link-71', 'GenKey', 'link-71');">GenKey</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">metadata</tt><tt class="py-op">.</tt><tt class="py-name">type</tt><tt class="py-op">,</tt> <tt id="link-72" class="py-name"><a title="keyczar.keys.Key.size" class="py-name" href="#" onclick="return doclink('link-72', 'size', 'link-56');">size</a></tt><tt class="py-op">)</tt> </tt>
<a name="L180"></a><tt class="py-lineno">180</tt>  <tt class="py-line">      <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_keys</tt><tt class="py-op">.</tt><tt class="py-name">get</tt><tt class="py-op">(</tt><tt class="py-name">key</tt><tt class="py-op">.</tt><tt id="link-73" class="py-name"><a title="keyczar.keys.Key.hash" class="py-name" href="#" onclick="return doclink('link-73', 'hash', 'link-31');">hash</a></tt><tt class="py-op">)</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L181"></a><tt class="py-lineno">181</tt>  <tt class="py-line">        <tt class="py-keyword">break</tt> </tt>
<a name="L182"></a><tt class="py-lineno">182</tt>  <tt class="py-line">     </tt>
<a name="L183"></a><tt class="py-lineno">183</tt>  <tt class="py-line">    <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-74" class="py-name" targets="Method keyczar.keyczar.Keyczar._AddKey()=keyczar.keyczar.Keyczar-class.html#_AddKey"><a title="keyczar.keyczar.Keyczar._AddKey" class="py-name" href="#" onclick="return doclink('link-74', '_AddKey', 'link-74');">_AddKey</a></tt><tt class="py-op">(</tt><tt class="py-name">version</tt><tt class="py-op">,</tt> <tt class="py-name">key</tt><tt class="py-op">)</tt> </tt>
</div><a name="L184"></a><tt class="py-lineno">184</tt>  <tt class="py-line">   </tt>
<a name="GenericKeyczar.Promote"></a><div id="GenericKeyczar.Promote-def"><a name="L185"></a><tt class="py-lineno">185</tt> <a class="py-toggle" href="#" id="GenericKeyczar.Promote-toggle" onclick="return toggle('GenericKeyczar.Promote');">-</a><tt class="py-line">  <tt class="py-keyword">def</tt> <a class="py-def-name" href="keyczar.keyczar.GenericKeyczar-class.html#Promote">Promote</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">version_number</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="GenericKeyczar.Promote-collapsed" style="display:none;" pad="+++" indent="++++++"></div><div id="GenericKeyczar.Promote-expanded"><a name="L186"></a><tt class="py-lineno">186</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L187"></a><tt class="py-lineno">187</tt>  <tt class="py-line"><tt class="py-docstring">    Promotes the status of key with given version number.</tt> </tt>
<a name="L188"></a><tt class="py-lineno">188</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L189"></a><tt class="py-lineno">189</tt>  <tt class="py-line"><tt class="py-docstring">    Promoting ACTIVE key automatically demotes current PRIMARY key to ACTIVE.</tt> </tt>
<a name="L190"></a><tt class="py-lineno">190</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L191"></a><tt class="py-lineno">191</tt>  <tt class="py-line"><tt class="py-docstring">    @param version_number: the version number to promote</tt> </tt>
<a name="L192"></a><tt class="py-lineno">192</tt>  <tt class="py-line"><tt class="py-docstring">    @type version_number: integer</tt> </tt>
<a name="L193"></a><tt class="py-lineno">193</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L194"></a><tt class="py-lineno">194</tt>  <tt class="py-line"><tt class="py-docstring">    @raise KeyczarError: if invalid version number or trying to promote </tt> </tt>
<a name="L195"></a><tt class="py-lineno">195</tt>  <tt class="py-line"><tt class="py-docstring">      a primary key</tt> </tt>
<a name="L196"></a><tt class="py-lineno">196</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L197"></a><tt class="py-lineno">197</tt>  <tt class="py-line">    <tt class="py-name">version</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">metadata</tt><tt class="py-op">.</tt><tt id="link-75" class="py-name" targets="Method keyczar.keydata.KeyMetadata.GetVersion()=keyczar.keydata.KeyMetadata-class.html#GetVersion"><a title="keyczar.keydata.KeyMetadata.GetVersion" class="py-name" href="#" onclick="return doclink('link-75', 'GetVersion', 'link-75');">GetVersion</a></tt><tt class="py-op">(</tt><tt class="py-name">version_number</tt><tt class="py-op">)</tt> </tt>
<a name="L198"></a><tt class="py-lineno">198</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">version</tt><tt class="py-op">.</tt><tt id="link-76" class="py-name"><a title="keyczar.keydata.KeyVersion.status" class="py-name" href="#" onclick="return doclink('link-76', 'status', 'link-23');">status</a></tt> <tt class="py-op">==</tt> <tt id="link-77" class="py-name"><a title="keyczar.keyinfo" class="py-name" href="#" onclick="return doclink('link-77', 'keyinfo', 'link-3');">keyinfo</a></tt><tt class="py-op">.</tt><tt id="link-78" class="py-name"><a title="keyczar.keyinfo.PRIMARY" class="py-name" href="#" onclick="return doclink('link-78', 'PRIMARY', 'link-25');">PRIMARY</a></tt><tt class="py-op">:</tt> </tt>
<a name="L199"></a><tt class="py-lineno">199</tt>  <tt class="py-line">      <tt class="py-keyword">raise</tt> <tt id="link-79" class="py-name"><a title="keyczar.errors" class="py-name" href="#" onclick="return doclink('link-79', 'errors', 'link-1');">errors</a></tt><tt class="py-op">.</tt><tt id="link-80" class="py-name"><a title="keyczar.errors.KeyczarError" class="py-name" href="#" onclick="return doclink('link-80', 'KeyczarError', 'link-17');">KeyczarError</a></tt><tt class="py-op">(</tt><tt class="py-string">"Can't promote a primary key."</tt><tt class="py-op">)</tt> </tt>
<a name="L200"></a><tt class="py-lineno">200</tt>  <tt class="py-line">    <tt class="py-keyword">elif</tt> <tt class="py-name">version</tt><tt class="py-op">.</tt><tt id="link-81" class="py-name"><a title="keyczar.keydata.KeyVersion.status" class="py-name" href="#" onclick="return doclink('link-81', 'status', 'link-23');">status</a></tt> <tt class="py-op">==</tt> <tt id="link-82" class="py-name"><a title="keyczar.keyinfo" class="py-name" href="#" onclick="return doclink('link-82', 'keyinfo', 'link-3');">keyinfo</a></tt><tt class="py-op">.</tt><tt id="link-83" class="py-name"><a title="keyczar.keyinfo.ACTIVE" class="py-name" href="#" onclick="return doclink('link-83', 'ACTIVE', 'link-67');">ACTIVE</a></tt><tt class="py-op">:</tt> </tt>
<a name="L201"></a><tt class="py-lineno">201</tt>  <tt class="py-line">      <tt class="py-name">version</tt><tt class="py-op">.</tt><tt id="link-84" class="py-name"><a title="keyczar.keydata.KeyVersion.status" class="py-name" href="#" onclick="return doclink('link-84', 'status', 'link-23');">status</a></tt> <tt class="py-op">=</tt> <tt id="link-85" class="py-name"><a title="keyczar.keyinfo" class="py-name" href="#" onclick="return doclink('link-85', 'keyinfo', 'link-3');">keyinfo</a></tt><tt class="py-op">.</tt><tt id="link-86" class="py-name"><a title="keyczar.keyinfo.PRIMARY" class="py-name" href="#" onclick="return doclink('link-86', 'PRIMARY', 'link-25');">PRIMARY</a></tt> </tt>
<a name="L202"></a><tt class="py-lineno">202</tt>  <tt class="py-line">      <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">primary_version</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L203"></a><tt class="py-lineno">203</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">primary_version</tt><tt class="py-op">.</tt><tt id="link-87" class="py-name"><a title="keyczar.keydata.KeyVersion.status" class="py-name" href="#" onclick="return doclink('link-87', 'status', 'link-23');">status</a></tt> <tt class="py-op">=</tt> <tt id="link-88" class="py-name"><a title="keyczar.keyinfo" class="py-name" href="#" onclick="return doclink('link-88', 'keyinfo', 'link-3');">keyinfo</a></tt><tt class="py-op">.</tt><tt id="link-89" class="py-name"><a title="keyczar.keyinfo.ACTIVE" class="py-name" href="#" onclick="return doclink('link-89', 'ACTIVE', 'link-67');">ACTIVE</a></tt>  <tt class="py-comment"># only one primary key</tt> </tt>
<a name="L204"></a><tt class="py-lineno">204</tt>  <tt class="py-line">      <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">primary_version</tt> <tt class="py-op">=</tt> <tt class="py-name">version</tt> </tt>
<a name="L205"></a><tt class="py-lineno">205</tt>  <tt class="py-line">    <tt class="py-keyword">elif</tt> <tt class="py-name">version</tt><tt class="py-op">.</tt><tt id="link-90" class="py-name"><a title="keyczar.keydata.KeyVersion.status" class="py-name" href="#" onclick="return doclink('link-90', 'status', 'link-23');">status</a></tt> <tt class="py-op">==</tt> <tt id="link-91" class="py-name"><a title="keyczar.keyinfo" class="py-name" href="#" onclick="return doclink('link-91', 'keyinfo', 'link-3');">keyinfo</a></tt><tt class="py-op">.</tt><tt id="link-92" class="py-name" targets="Variable keyczar.keyinfo.INACTIVE=keyczar.keyinfo-module.html#INACTIVE"><a title="keyczar.keyinfo.INACTIVE" class="py-name" href="#" onclick="return doclink('link-92', 'INACTIVE', 'link-92');">INACTIVE</a></tt><tt class="py-op">:</tt> </tt>
<a name="L206"></a><tt class="py-lineno">206</tt>  <tt class="py-line">      <tt class="py-name">version</tt><tt class="py-op">.</tt><tt id="link-93" class="py-name"><a title="keyczar.keydata.KeyVersion.status" class="py-name" href="#" onclick="return doclink('link-93', 'status', 'link-23');">status</a></tt> <tt class="py-op">=</tt> <tt id="link-94" class="py-name"><a title="keyczar.keyinfo" class="py-name" href="#" onclick="return doclink('link-94', 'keyinfo', 'link-3');">keyinfo</a></tt><tt class="py-op">.</tt><tt id="link-95" class="py-name"><a title="keyczar.keyinfo.ACTIVE" class="py-name" href="#" onclick="return doclink('link-95', 'ACTIVE', 'link-67');">ACTIVE</a></tt> </tt>
</div><a name="L207"></a><tt class="py-lineno">207</tt>  <tt class="py-line">   </tt>
<a name="GenericKeyczar.Demote"></a><div id="GenericKeyczar.Demote-def"><a name="L208"></a><tt class="py-lineno">208</tt> <a class="py-toggle" href="#" id="GenericKeyczar.Demote-toggle" onclick="return toggle('GenericKeyczar.Demote');">-</a><tt class="py-line">  <tt class="py-keyword">def</tt> <a class="py-def-name" href="keyczar.keyczar.GenericKeyczar-class.html#Demote">Demote</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">version_number</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="GenericKeyczar.Demote-collapsed" style="display:none;" pad="+++" indent="++++++"></div><div id="GenericKeyczar.Demote-expanded"><a name="L209"></a><tt class="py-lineno">209</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L210"></a><tt class="py-lineno">210</tt>  <tt class="py-line"><tt class="py-docstring">    Demotes the status of key with given version number.</tt> </tt>
<a name="L211"></a><tt class="py-lineno">211</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L212"></a><tt class="py-lineno">212</tt>  <tt class="py-line"><tt class="py-docstring">    Demoting PRIMARY key results in a key set with no primary version.</tt> </tt>
<a name="L213"></a><tt class="py-lineno">213</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L214"></a><tt class="py-lineno">214</tt>  <tt class="py-line"><tt class="py-docstring">    @param version_number: the version number to demote</tt> </tt>
<a name="L215"></a><tt class="py-lineno">215</tt>  <tt class="py-line"><tt class="py-docstring">    @type version_number: integer</tt> </tt>
<a name="L216"></a><tt class="py-lineno">216</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L217"></a><tt class="py-lineno">217</tt>  <tt class="py-line"><tt class="py-docstring">    @raise KeyczarError: if invalid version number or trying to demote an</tt> </tt>
<a name="L218"></a><tt class="py-lineno">218</tt>  <tt class="py-line"><tt class="py-docstring">    inactive key, use L{Revoke} instead.</tt> </tt>
<a name="L219"></a><tt class="py-lineno">219</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L220"></a><tt class="py-lineno">220</tt>  <tt class="py-line">    <tt class="py-name">version</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">metadata</tt><tt class="py-op">.</tt><tt id="link-96" class="py-name"><a title="keyczar.keydata.KeyMetadata.GetVersion" class="py-name" href="#" onclick="return doclink('link-96', 'GetVersion', 'link-75');">GetVersion</a></tt><tt class="py-op">(</tt><tt class="py-name">version_number</tt><tt class="py-op">)</tt> </tt>
<a name="L221"></a><tt class="py-lineno">221</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">version</tt><tt class="py-op">.</tt><tt id="link-97" class="py-name"><a title="keyczar.keydata.KeyVersion.status" class="py-name" href="#" onclick="return doclink('link-97', 'status', 'link-23');">status</a></tt> <tt class="py-op">==</tt> <tt id="link-98" class="py-name"><a title="keyczar.keyinfo" class="py-name" href="#" onclick="return doclink('link-98', 'keyinfo', 'link-3');">keyinfo</a></tt><tt class="py-op">.</tt><tt id="link-99" class="py-name"><a title="keyczar.keyinfo.PRIMARY" class="py-name" href="#" onclick="return doclink('link-99', 'PRIMARY', 'link-25');">PRIMARY</a></tt><tt class="py-op">:</tt> </tt>
<a name="L222"></a><tt class="py-lineno">222</tt>  <tt class="py-line">      <tt class="py-name">version</tt><tt class="py-op">.</tt><tt id="link-100" class="py-name"><a title="keyczar.keydata.KeyVersion.status" class="py-name" href="#" onclick="return doclink('link-100', 'status', 'link-23');">status</a></tt> <tt class="py-op">=</tt> <tt id="link-101" class="py-name"><a title="keyczar.keyinfo" class="py-name" href="#" onclick="return doclink('link-101', 'keyinfo', 'link-3');">keyinfo</a></tt><tt class="py-op">.</tt><tt id="link-102" class="py-name"><a title="keyczar.keyinfo.ACTIVE" class="py-name" href="#" onclick="return doclink('link-102', 'ACTIVE', 'link-67');">ACTIVE</a></tt> </tt>
<a name="L223"></a><tt class="py-lineno">223</tt>  <tt class="py-line">      <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">primary_version</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt>  <tt class="py-comment"># no more primary keys in the set</tt> </tt>
<a name="L224"></a><tt class="py-lineno">224</tt>  <tt class="py-line">    <tt class="py-keyword">elif</tt> <tt class="py-name">version</tt><tt class="py-op">.</tt><tt id="link-103" class="py-name"><a title="keyczar.keydata.KeyVersion.status" class="py-name" href="#" onclick="return doclink('link-103', 'status', 'link-23');">status</a></tt> <tt class="py-op">==</tt> <tt id="link-104" class="py-name"><a title="keyczar.keyinfo" class="py-name" href="#" onclick="return doclink('link-104', 'keyinfo', 'link-3');">keyinfo</a></tt><tt class="py-op">.</tt><tt id="link-105" class="py-name"><a title="keyczar.keyinfo.ACTIVE" class="py-name" href="#" onclick="return doclink('link-105', 'ACTIVE', 'link-67');">ACTIVE</a></tt><tt class="py-op">:</tt> </tt>
<a name="L225"></a><tt class="py-lineno">225</tt>  <tt class="py-line">      <tt class="py-name">version</tt><tt class="py-op">.</tt><tt id="link-106" class="py-name"><a title="keyczar.keydata.KeyVersion.status" class="py-name" href="#" onclick="return doclink('link-106', 'status', 'link-23');">status</a></tt> <tt class="py-op">=</tt> <tt id="link-107" class="py-name"><a title="keyczar.keyinfo" class="py-name" href="#" onclick="return doclink('link-107', 'keyinfo', 'link-3');">keyinfo</a></tt><tt class="py-op">.</tt><tt id="link-108" class="py-name"><a title="keyczar.keyinfo.INACTIVE" class="py-name" href="#" onclick="return doclink('link-108', 'INACTIVE', 'link-92');">INACTIVE</a></tt> </tt>
<a name="L226"></a><tt class="py-lineno">226</tt>  <tt class="py-line">    <tt class="py-keyword">elif</tt> <tt class="py-name">version</tt><tt class="py-op">.</tt><tt id="link-109" class="py-name"><a title="keyczar.keydata.KeyVersion.status" class="py-name" href="#" onclick="return doclink('link-109', 'status', 'link-23');">status</a></tt> <tt class="py-op">==</tt> <tt id="link-110" class="py-name"><a title="keyczar.keyinfo" class="py-name" href="#" onclick="return doclink('link-110', 'keyinfo', 'link-3');">keyinfo</a></tt><tt class="py-op">.</tt><tt id="link-111" class="py-name"><a title="keyczar.keyinfo.INACTIVE" class="py-name" href="#" onclick="return doclink('link-111', 'INACTIVE', 'link-92');">INACTIVE</a></tt><tt class="py-op">:</tt> </tt>
<a name="L227"></a><tt class="py-lineno">227</tt>  <tt class="py-line">      <tt class="py-keyword">raise</tt> <tt id="link-112" class="py-name"><a title="keyczar.errors" class="py-name" href="#" onclick="return doclink('link-112', 'errors', 'link-1');">errors</a></tt><tt class="py-op">.</tt><tt id="link-113" class="py-name"><a title="keyczar.errors.KeyczarError" class="py-name" href="#" onclick="return doclink('link-113', 'KeyczarError', 'link-17');">KeyczarError</a></tt><tt class="py-op">(</tt><tt class="py-string">"Can't demote an inactive key, only revoke."</tt><tt class="py-op">)</tt> </tt>
</div><a name="L228"></a><tt class="py-lineno">228</tt>  <tt class="py-line">   </tt>
<a name="GenericKeyczar.Revoke"></a><div id="GenericKeyczar.Revoke-def"><a name="L229"></a><tt class="py-lineno">229</tt> <a class="py-toggle" href="#" id="GenericKeyczar.Revoke-toggle" onclick="return toggle('GenericKeyczar.Revoke');">-</a><tt class="py-line">  <tt class="py-keyword">def</tt> <a class="py-def-name" href="keyczar.keyczar.GenericKeyczar-class.html#Revoke">Revoke</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">version_number</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="GenericKeyczar.Revoke-collapsed" style="display:none;" pad="+++" indent="++++++"></div><div id="GenericKeyczar.Revoke-expanded"><a name="L230"></a><tt class="py-lineno">230</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L231"></a><tt class="py-lineno">231</tt>  <tt class="py-line"><tt class="py-docstring">    Revokes the key with given version number if scheduled to be revoked.</tt> </tt>
<a name="L232"></a><tt class="py-lineno">232</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L233"></a><tt class="py-lineno">233</tt>  <tt class="py-line"><tt class="py-docstring">    @param version_number: integer version number to revoke</tt> </tt>
<a name="L234"></a><tt class="py-lineno">234</tt>  <tt class="py-line"><tt class="py-docstring">    @type version_number: integer</tt> </tt>
<a name="L235"></a><tt class="py-lineno">235</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L236"></a><tt class="py-lineno">236</tt>  <tt class="py-line"><tt class="py-docstring">    @raise KeyczarError: if invalid version number or key is not inactive.</tt> </tt>
<a name="L237"></a><tt class="py-lineno">237</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L238"></a><tt class="py-lineno">238</tt>  <tt class="py-line">    <tt class="py-name">version</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">metadata</tt><tt class="py-op">.</tt><tt id="link-114" class="py-name"><a title="keyczar.keydata.KeyMetadata.GetVersion" class="py-name" href="#" onclick="return doclink('link-114', 'GetVersion', 'link-75');">GetVersion</a></tt><tt class="py-op">(</tt><tt class="py-name">version_number</tt><tt class="py-op">)</tt> </tt>
<a name="L239"></a><tt class="py-lineno">239</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">version</tt><tt class="py-op">.</tt><tt id="link-115" class="py-name"><a title="keyczar.keydata.KeyVersion.status" class="py-name" href="#" onclick="return doclink('link-115', 'status', 'link-23');">status</a></tt> <tt class="py-op">==</tt> <tt id="link-116" class="py-name"><a title="keyczar.keyinfo" class="py-name" href="#" onclick="return doclink('link-116', 'keyinfo', 'link-3');">keyinfo</a></tt><tt class="py-op">.</tt><tt id="link-117" class="py-name"><a title="keyczar.keyinfo.INACTIVE" class="py-name" href="#" onclick="return doclink('link-117', 'INACTIVE', 'link-92');">INACTIVE</a></tt><tt class="py-op">:</tt> </tt>
<a name="L240"></a><tt class="py-lineno">240</tt>  <tt class="py-line">      <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">metadata</tt><tt class="py-op">.</tt><tt id="link-118" class="py-name" targets="Method keyczar.keydata.KeyMetadata.RemoveVersion()=keyczar.keydata.KeyMetadata-class.html#RemoveVersion"><a title="keyczar.keydata.KeyMetadata.RemoveVersion" class="py-name" href="#" onclick="return doclink('link-118', 'RemoveVersion', 'link-118');">RemoveVersion</a></tt><tt class="py-op">(</tt><tt class="py-name">version_number</tt><tt class="py-op">)</tt> </tt>
<a name="L241"></a><tt class="py-lineno">241</tt>  <tt class="py-line">    <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L242"></a><tt class="py-lineno">242</tt>  <tt class="py-line">      <tt class="py-keyword">raise</tt> <tt id="link-119" class="py-name"><a title="keyczar.errors" class="py-name" href="#" onclick="return doclink('link-119', 'errors', 'link-1');">errors</a></tt><tt class="py-op">.</tt><tt id="link-120" class="py-name"><a title="keyczar.errors.KeyczarError" class="py-name" href="#" onclick="return doclink('link-120', 'KeyczarError', 'link-17');">KeyczarError</a></tt><tt class="py-op">(</tt><tt class="py-string">"Can't revoke key if not inactive."</tt><tt class="py-op">)</tt> </tt>
</div><a name="L243"></a><tt class="py-lineno">243</tt>  <tt class="py-line">   </tt>
<a name="GenericKeyczar.PublicKeyExport"></a><div id="GenericKeyczar.PublicKeyExport-def"><a name="L244"></a><tt class="py-lineno">244</tt> <a class="py-toggle" href="#" id="GenericKeyczar.PublicKeyExport-toggle" onclick="return toggle('GenericKeyczar.PublicKeyExport');">-</a><tt class="py-line">  <tt class="py-keyword">def</tt> <a class="py-def-name" href="keyczar.keyczar.GenericKeyczar-class.html#PublicKeyExport">PublicKeyExport</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">dest</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="GenericKeyczar.PublicKeyExport-collapsed" style="display:none;" pad="+++" indent="++++++"></div><div id="GenericKeyczar.PublicKeyExport-expanded"><a name="L245"></a><tt class="py-lineno">245</tt>  <tt class="py-line">    <tt class="py-docstring">"""Export the public keys corresponding to our key set to destination."""</tt> </tt>
<a name="L246"></a><tt class="py-lineno">246</tt>  <tt class="py-line">    <tt class="py-name">kmd</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">metadata</tt> </tt>
<a name="L247"></a><tt class="py-lineno">247</tt>  <tt class="py-line">    <tt class="py-name">pubkmd</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt> </tt>
<a name="L248"></a><tt class="py-lineno">248</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">kmd</tt><tt class="py-op">.</tt><tt class="py-name">type</tt> <tt class="py-op">==</tt> <tt id="link-121" class="py-name"><a title="keyczar.keyinfo" class="py-name" href="#" onclick="return doclink('link-121', 'keyinfo', 'link-3');">keyinfo</a></tt><tt class="py-op">.</tt><tt id="link-122" class="py-name" targets="Variable keyczar.keyinfo.DSA_PRIV=keyczar.keyinfo-module.html#DSA_PRIV"><a title="keyczar.keyinfo.DSA_PRIV" class="py-name" href="#" onclick="return doclink('link-122', 'DSA_PRIV', 'link-122');">DSA_PRIV</a></tt> <tt class="py-keyword">and</tt> <tt class="py-name">kmd</tt><tt class="py-op">.</tt><tt class="py-name">purpose</tt> <tt class="py-op">==</tt> <tt id="link-123" class="py-name"><a title="keyczar.keyinfo" class="py-name" href="#" onclick="return doclink('link-123', 'keyinfo', 'link-3');">keyinfo</a></tt><tt class="py-op">.</tt><tt id="link-124" class="py-name" targets="Variable keyczar.keyinfo.SIGN_AND_VERIFY=keyczar.keyinfo-module.html#SIGN_AND_VERIFY"><a title="keyczar.keyinfo.SIGN_AND_VERIFY" class="py-name" href="#" onclick="return doclink('link-124', 'SIGN_AND_VERIFY', 'link-124');">SIGN_AND_VERIFY</a></tt><tt class="py-op">:</tt> </tt>
<a name="L249"></a><tt class="py-lineno">249</tt>  <tt class="py-line">      <tt class="py-name">pubkmd</tt> <tt class="py-op">=</tt> <tt id="link-125" class="py-name"><a title="keyczar.keydata" class="py-name" href="#" onclick="return doclink('link-125', 'keydata', 'link-2');">keydata</a></tt><tt class="py-op">.</tt><tt id="link-126" class="py-name"><a title="keyczar.keydata.KeyMetadata" class="py-name" href="#" onclick="return doclink('link-126', 'KeyMetadata', 'link-12');">KeyMetadata</a></tt><tt class="py-op">(</tt><tt class="py-name">kmd</tt><tt class="py-op">.</tt><tt class="py-name">name</tt><tt class="py-op">,</tt> <tt id="link-127" class="py-name"><a title="keyczar.keyinfo" class="py-name" href="#" onclick="return doclink('link-127', 'keyinfo', 'link-3');">keyinfo</a></tt><tt class="py-op">.</tt><tt id="link-128" class="py-name" targets="Variable keyczar.keyinfo.VERIFY=keyczar.keyinfo-module.html#VERIFY"><a title="keyczar.keyinfo.VERIFY" class="py-name" href="#" onclick="return doclink('link-128', 'VERIFY', 'link-128');">VERIFY</a></tt><tt class="py-op">,</tt> <tt id="link-129" class="py-name"><a title="keyczar.keyinfo" class="py-name" href="#" onclick="return doclink('link-129', 'keyinfo', 'link-3');">keyinfo</a></tt><tt class="py-op">.</tt><tt id="link-130" class="py-name" targets="Variable keyczar.keyinfo.DSA_PUB=keyczar.keyinfo-module.html#DSA_PUB"><a title="keyczar.keyinfo.DSA_PUB" class="py-name" href="#" onclick="return doclink('link-130', 'DSA_PUB', 'link-130');">DSA_PUB</a></tt><tt class="py-op">)</tt> </tt>
<a name="L250"></a><tt class="py-lineno">250</tt>  <tt class="py-line">    <tt class="py-keyword">elif</tt> <tt class="py-name">kmd</tt><tt class="py-op">.</tt><tt class="py-name">type</tt> <tt class="py-op">==</tt> <tt id="link-131" class="py-name"><a title="keyczar.keyinfo" class="py-name" href="#" onclick="return doclink('link-131', 'keyinfo', 'link-3');">keyinfo</a></tt><tt class="py-op">.</tt><tt id="link-132" class="py-name" targets="Variable keyczar.keyinfo.RSA_PRIV=keyczar.keyinfo-module.html#RSA_PRIV"><a title="keyczar.keyinfo.RSA_PRIV" class="py-name" href="#" onclick="return doclink('link-132', 'RSA_PRIV', 'link-132');">RSA_PRIV</a></tt><tt class="py-op">:</tt> </tt>
<a name="L251"></a><tt class="py-lineno">251</tt>  <tt class="py-line">      <tt class="py-keyword">if</tt> <tt class="py-name">kmd</tt><tt class="py-op">.</tt><tt class="py-name">purpose</tt> <tt class="py-op">==</tt> <tt id="link-133" class="py-name"><a title="keyczar.keyinfo" class="py-name" href="#" onclick="return doclink('link-133', 'keyinfo', 'link-3');">keyinfo</a></tt><tt class="py-op">.</tt><tt id="link-134" class="py-name" targets="Variable keyczar.keyinfo.DECRYPT_AND_ENCRYPT=keyczar.keyinfo-module.html#DECRYPT_AND_ENCRYPT"><a title="keyczar.keyinfo.DECRYPT_AND_ENCRYPT" class="py-name" href="#" onclick="return doclink('link-134', 'DECRYPT_AND_ENCRYPT', 'link-134');">DECRYPT_AND_ENCRYPT</a></tt><tt class="py-op">:</tt> </tt>
<a name="L252"></a><tt class="py-lineno">252</tt>  <tt class="py-line">        <tt class="py-name">pubkmd</tt> <tt class="py-op">=</tt> <tt id="link-135" class="py-name"><a title="keyczar.keydata" class="py-name" href="#" onclick="return doclink('link-135', 'keydata', 'link-2');">keydata</a></tt><tt class="py-op">.</tt><tt id="link-136" class="py-name"><a title="keyczar.keydata.KeyMetadata" class="py-name" href="#" onclick="return doclink('link-136', 'KeyMetadata', 'link-12');">KeyMetadata</a></tt><tt class="py-op">(</tt><tt class="py-name">kmd</tt><tt class="py-op">.</tt><tt class="py-name">name</tt><tt class="py-op">,</tt> <tt id="link-137" class="py-name"><a title="keyczar.keyinfo" class="py-name" href="#" onclick="return doclink('link-137', 'keyinfo', 'link-3');">keyinfo</a></tt><tt class="py-op">.</tt><tt id="link-138" class="py-name" targets="Variable keyczar.keyinfo.ENCRYPT=keyczar.keyinfo-module.html#ENCRYPT"><a title="keyczar.keyinfo.ENCRYPT" class="py-name" href="#" onclick="return doclink('link-138', 'ENCRYPT', 'link-138');">ENCRYPT</a></tt><tt class="py-op">,</tt> <tt id="link-139" class="py-name"><a title="keyczar.keyinfo" class="py-name" href="#" onclick="return doclink('link-139', 'keyinfo', 'link-3');">keyinfo</a></tt><tt class="py-op">.</tt><tt id="link-140" class="py-name" targets="Variable keyczar.keyinfo.RSA_PUB=keyczar.keyinfo-module.html#RSA_PUB"><a title="keyczar.keyinfo.RSA_PUB" class="py-name" href="#" onclick="return doclink('link-140', 'RSA_PUB', 'link-140');">RSA_PUB</a></tt><tt class="py-op">)</tt> </tt>
<a name="L253"></a><tt class="py-lineno">253</tt>  <tt class="py-line">      <tt class="py-keyword">elif</tt> <tt class="py-name">kmd</tt><tt class="py-op">.</tt><tt class="py-name">purpose</tt> <tt class="py-op">==</tt> <tt id="link-141" class="py-name"><a title="keyczar.keyinfo" class="py-name" href="#" onclick="return doclink('link-141', 'keyinfo', 'link-3');">keyinfo</a></tt><tt class="py-op">.</tt><tt id="link-142" class="py-name"><a title="keyczar.keyinfo.SIGN_AND_VERIFY" class="py-name" href="#" onclick="return doclink('link-142', 'SIGN_AND_VERIFY', 'link-124');">SIGN_AND_VERIFY</a></tt><tt class="py-op">:</tt> </tt>
<a name="L254"></a><tt class="py-lineno">254</tt>  <tt class="py-line">        <tt class="py-name">pubkmd</tt> <tt class="py-op">=</tt> <tt id="link-143" class="py-name"><a title="keyczar.keydata" class="py-name" href="#" onclick="return doclink('link-143', 'keydata', 'link-2');">keydata</a></tt><tt class="py-op">.</tt><tt id="link-144" class="py-name"><a title="keyczar.keydata.KeyMetadata" class="py-name" href="#" onclick="return doclink('link-144', 'KeyMetadata', 'link-12');">KeyMetadata</a></tt><tt class="py-op">(</tt><tt class="py-name">kmd</tt><tt class="py-op">.</tt><tt class="py-name">name</tt><tt class="py-op">,</tt> <tt id="link-145" class="py-name"><a title="keyczar.keyinfo" class="py-name" href="#" onclick="return doclink('link-145', 'keyinfo', 'link-3');">keyinfo</a></tt><tt class="py-op">.</tt><tt id="link-146" class="py-name"><a title="keyczar.keyinfo.VERIFY" class="py-name" href="#" onclick="return doclink('link-146', 'VERIFY', 'link-128');">VERIFY</a></tt><tt class="py-op">,</tt> <tt id="link-147" class="py-name"><a title="keyczar.keyinfo" class="py-name" href="#" onclick="return doclink('link-147', 'keyinfo', 'link-3');">keyinfo</a></tt><tt class="py-op">.</tt><tt id="link-148" class="py-name"><a title="keyczar.keyinfo.RSA_PUB" class="py-name" href="#" onclick="return doclink('link-148', 'RSA_PUB', 'link-140');">RSA_PUB</a></tt><tt class="py-op">)</tt> </tt>
<a name="L255"></a><tt class="py-lineno">255</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">pubkmd</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L256"></a><tt class="py-lineno">256</tt>  <tt class="py-line">      <tt class="py-keyword">raise</tt> <tt id="link-149" class="py-name"><a title="keyczar.errors" class="py-name" href="#" onclick="return doclink('link-149', 'errors', 'link-1');">errors</a></tt><tt class="py-op">.</tt><tt id="link-150" class="py-name"><a title="keyczar.errors.KeyczarError" class="py-name" href="#" onclick="return doclink('link-150', 'KeyczarError', 'link-17');">KeyczarError</a></tt><tt class="py-op">(</tt><tt class="py-string">"Cannot export public key"</tt><tt class="py-op">)</tt> </tt>
<a name="L257"></a><tt class="py-lineno">257</tt>  <tt class="py-line">    <tt class="py-keyword">for</tt> <tt class="py-name">v</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-151" class="py-name"><a title="keyczar.keyczar.Keyczar.versions
keyczar.keydata.KeyMetadata.versions" class="py-name" href="#" onclick="return doclink('link-151', 'versions', 'link-22');">versions</a></tt><tt class="py-op">:</tt> </tt>
<a name="L258"></a><tt class="py-lineno">258</tt>  <tt class="py-line">      <tt class="py-name">pubkmd</tt><tt class="py-op">.</tt><tt id="link-152" class="py-name"><a title="keyczar.keyczar.GenericKeyczar.AddVersion
keyczar.keydata.KeyMetadata.AddVersion" class="py-name" href="#" onclick="return doclink('link-152', 'AddVersion', 'link-52');">AddVersion</a></tt><tt class="py-op">(</tt><tt class="py-name">v</tt><tt class="py-op">)</tt> </tt>
<a name="L259"></a><tt class="py-lineno">259</tt>  <tt class="py-line">      <tt class="py-name">pubkey</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-153" class="py-name"><a title="keyczar.keyczar.Keyczar.GetKey
keyczar.readers.EncryptedReader.GetKey
keyczar.readers.FileReader.GetKey
keyczar.readers.Reader.GetKey" class="py-name" href="#" onclick="return doclink('link-153', 'GetKey', 'link-30');">GetKey</a></tt><tt class="py-op">(</tt><tt class="py-name">v</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">public_key</tt> </tt>
<a name="L260"></a><tt class="py-lineno">260</tt>  <tt class="py-line">      <tt id="link-154" class="py-name"><a title="keyczar.util" class="py-name" href="#" onclick="return doclink('link-154', 'util', 'link-6');">util</a></tt><tt class="py-op">.</tt><tt id="link-155" class="py-name" targets="Function keyczar.util.WriteFile()=keyczar.util-module.html#WriteFile"><a title="keyczar.util.WriteFile" class="py-name" href="#" onclick="return doclink('link-155', 'WriteFile', 'link-155');">WriteFile</a></tt><tt class="py-op">(</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">pubkey</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">path</tt><tt class="py-op">.</tt><tt class="py-name">join</tt><tt class="py-op">(</tt><tt class="py-name">dest</tt><tt class="py-op">,</tt> <tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">v</tt><tt class="py-op">.</tt><tt class="py-name">version_number</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L261"></a><tt class="py-lineno">261</tt>  <tt class="py-line">    <tt id="link-156" class="py-name"><a title="keyczar.util" class="py-name" href="#" onclick="return doclink('link-156', 'util', 'link-6');">util</a></tt><tt class="py-op">.</tt><tt id="link-157" class="py-name"><a title="keyczar.util.WriteFile" class="py-name" href="#" onclick="return doclink('link-157', 'WriteFile', 'link-155');">WriteFile</a></tt><tt class="py-op">(</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">pubkmd</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">path</tt><tt class="py-op">.</tt><tt class="py-name">join</tt><tt class="py-op">(</tt><tt class="py-name">dest</tt><tt class="py-op">,</tt> <tt class="py-string">"meta"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="L262"></a><tt class="py-lineno">262</tt>  <tt class="py-line">   </tt>
<a name="GenericKeyczar.Write"></a><div id="GenericKeyczar.Write-def"><a name="L263"></a><tt class="py-lineno">263</tt> <a class="py-toggle" href="#" id="GenericKeyczar.Write-toggle" onclick="return toggle('GenericKeyczar.Write');">-</a><tt class="py-line">  <tt class="py-keyword">def</tt> <a class="py-def-name" href="keyczar.keyczar.GenericKeyczar-class.html#Write">Write</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">loc</tt><tt class="py-op">,</tt> <tt class="py-param">encrypter</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="GenericKeyczar.Write-collapsed" style="display:none;" pad="+++" indent="++++++"></div><div id="GenericKeyczar.Write-expanded"><a name="L264"></a><tt class="py-lineno">264</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">encrypter</tt><tt class="py-op">:</tt> </tt>
<a name="L265"></a><tt class="py-lineno">265</tt>  <tt class="py-line">      <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">metadata</tt><tt class="py-op">.</tt><tt class="py-name">encrypted</tt> <tt class="py-op">=</tt> <tt class="py-name">True</tt> </tt>
<a name="L266"></a><tt class="py-lineno">266</tt>  <tt class="py-line">    <tt id="link-158" class="py-name"><a title="keyczar.util" class="py-name" href="#" onclick="return doclink('link-158', 'util', 'link-6');">util</a></tt><tt class="py-op">.</tt><tt id="link-159" class="py-name"><a title="keyczar.util.WriteFile" class="py-name" href="#" onclick="return doclink('link-159', 'WriteFile', 'link-155');">WriteFile</a></tt><tt class="py-op">(</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">metadata</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">path</tt><tt class="py-op">.</tt><tt class="py-name">join</tt><tt class="py-op">(</tt><tt class="py-name">loc</tt><tt class="py-op">,</tt> <tt class="py-string">"meta"</tt><tt class="py-op">)</tt><tt class="py-op">)</tt>  <tt class="py-comment"># just plain</tt> </tt>
<a name="L267"></a><tt class="py-lineno">267</tt>  <tt class="py-line">    <tt class="py-keyword">for</tt> <tt class="py-name">v</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-160" class="py-name"><a title="keyczar.keyczar.Keyczar.versions
keyczar.keydata.KeyMetadata.versions" class="py-name" href="#" onclick="return doclink('link-160', 'versions', 'link-22');">versions</a></tt><tt class="py-op">:</tt> </tt>
<a name="L268"></a><tt class="py-lineno">268</tt>  <tt class="py-line">      <tt class="py-name">key</tt> <tt class="py-op">=</tt> <tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-161" class="py-name"><a title="keyczar.keyczar.Keyczar.GetKey
keyczar.readers.EncryptedReader.GetKey
keyczar.readers.FileReader.GetKey
keyczar.readers.Reader.GetKey" class="py-name" href="#" onclick="return doclink('link-161', 'GetKey', 'link-30');">GetKey</a></tt><tt class="py-op">(</tt><tt class="py-name">v</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L269"></a><tt class="py-lineno">269</tt>  <tt class="py-line">      <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">metadata</tt><tt class="py-op">.</tt><tt class="py-name">encrypted</tt><tt class="py-op">:</tt> </tt>
<a name="L270"></a><tt class="py-lineno">270</tt>  <tt class="py-line">        <tt class="py-name">key</tt> <tt class="py-op">=</tt> <tt class="py-name">encrypter</tt><tt class="py-op">.</tt><tt id="link-162" class="py-name" targets="Method keyczar.keyczar.Encrypter.Encrypt()=keyczar.keyczar.Encrypter-class.html#Encrypt,Method keyczar.keys.AesKey.Encrypt()=keyczar.keys.AesKey-class.html#Encrypt,Method keyczar.keys.RsaPrivateKey.Encrypt()=keyczar.keys.RsaPrivateKey-class.html#Encrypt,Method keyczar.keys.RsaPublicKey.Encrypt()=keyczar.keys.RsaPublicKey-class.html#Encrypt"><a title="keyczar.keyczar.Encrypter.Encrypt
keyczar.keys.AesKey.Encrypt
keyczar.keys.RsaPrivateKey.Encrypt
keyczar.keys.RsaPublicKey.Encrypt" class="py-name" href="#" onclick="return doclink('link-162', 'Encrypt', 'link-162');">Encrypt</a></tt><tt class="py-op">(</tt><tt class="py-name">key</tt><tt class="py-op">)</tt>  <tt class="py-comment"># encrypt key info before outputting</tt> </tt>
<a name="L271"></a><tt class="py-lineno">271</tt>  <tt class="py-line">      <tt id="link-163" class="py-name"><a title="keyczar.util" class="py-name" href="#" onclick="return doclink('link-163', 'util', 'link-6');">util</a></tt><tt class="py-op">.</tt><tt id="link-164" class="py-name"><a title="keyczar.util.WriteFile" class="py-name" href="#" onclick="return doclink('link-164', 'WriteFile', 'link-155');">WriteFile</a></tt><tt class="py-op">(</tt><tt class="py-name">key</tt><tt class="py-op">,</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">path</tt><tt class="py-op">.</tt><tt class="py-name">join</tt><tt class="py-op">(</tt><tt class="py-name">loc</tt><tt class="py-op">,</tt> <tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">v</tt><tt class="py-op">.</tt><tt class="py-name">version_number</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L272"></a><tt class="py-lineno">272</tt>  <tt class="py-line"> </tt>
<a name="Encrypter"></a><div id="Encrypter-def"><a name="L273"></a><tt class="py-lineno">273</tt> <a class="py-toggle" href="#" id="Encrypter-toggle" onclick="return toggle('Encrypter');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="keyczar.keyczar.Encrypter-class.html">Encrypter</a><tt class="py-op">(</tt><tt class="py-base-class">Keyczar</tt><tt class="py-op">)</tt><tt class="py-op">:</tt>   </tt>
</div><a name="L274"></a><tt class="py-lineno">274</tt>  <tt class="py-line">  <tt class="py-docstring">"""Capable of encrypting only."""</tt> </tt>
<a name="L275"></a><tt class="py-lineno">275</tt>  <tt class="py-line">   </tt>
<a name="L276"></a><tt class="py-lineno">276</tt>  <tt class="py-line">  <tt class="py-decorator">@</tt><tt class="py-decorator">staticmethod</tt> </tt>
<a name="Encrypter.Read"></a><div id="Encrypter.Read-def"><a name="L277"></a><tt class="py-lineno">277</tt> <a class="py-toggle" href="#" id="Encrypter.Read-toggle" onclick="return toggle('Encrypter.Read');">-</a><tt class="py-line">  <tt class="py-keyword">def</tt> <a class="py-def-name" href="keyczar.keyczar.Encrypter-class.html#Read">Read</a><tt class="py-op">(</tt><tt class="py-param">location</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Encrypter.Read-collapsed" style="display:none;" pad="+++" indent="++++++"></div><div id="Encrypter.Read-expanded"><a name="L278"></a><tt class="py-lineno">278</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L279"></a><tt class="py-lineno">279</tt>  <tt class="py-line"><tt class="py-docstring">    Return an Encrypter object created from FileReader at given location.</tt> </tt>
<a name="L280"></a><tt class="py-lineno">280</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L281"></a><tt class="py-lineno">281</tt>  <tt class="py-line"><tt class="py-docstring">    @param location: pathname of the directory storing the key files</tt> </tt>
<a name="L282"></a><tt class="py-lineno">282</tt>  <tt class="py-line"><tt class="py-docstring">    @type location: string</tt> </tt>
<a name="L283"></a><tt class="py-lineno">283</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L284"></a><tt class="py-lineno">284</tt>  <tt class="py-line"><tt class="py-docstring">    @return: an Encrypter to manage the keys stored at the given location and</tt> </tt>
<a name="L285"></a><tt class="py-lineno">285</tt>  <tt class="py-line"><tt class="py-docstring">      perform encryption functions.</tt> </tt>
<a name="L286"></a><tt class="py-lineno">286</tt>  <tt class="py-line"><tt class="py-docstring">    @rtype: L{Encrypter}</tt> </tt>
<a name="L287"></a><tt class="py-lineno">287</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L288"></a><tt class="py-lineno">288</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt id="link-165" class="py-name" targets="Class keyczar.keyczar.Encrypter=keyczar.keyczar.Encrypter-class.html"><a title="keyczar.keyczar.Encrypter" class="py-name" href="#" onclick="return doclink('link-165', 'Encrypter', 'link-165');">Encrypter</a></tt><tt class="py-op">(</tt><tt id="link-166" class="py-name"><a title="keyczar.readers" class="py-name" href="#" onclick="return doclink('link-166', 'readers', 'link-5');">readers</a></tt><tt class="py-op">.</tt><tt id="link-167" class="py-name"><a title="keyczar.readers.FileReader" class="py-name" href="#" onclick="return doclink('link-167', 'FileReader', 'link-48');">FileReader</a></tt><tt class="py-op">(</tt><tt class="py-name">location</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="L289"></a><tt class="py-lineno">289</tt>  <tt class="py-line">   </tt>
<a name="Encrypter.IsAcceptablePurpose"></a><div id="Encrypter.IsAcceptablePurpose-def"><a name="L290"></a><tt class="py-lineno">290</tt> <a class="py-toggle" href="#" id="Encrypter.IsAcceptablePurpose-toggle" onclick="return toggle('Encrypter.IsAcceptablePurpose');">-</a><tt class="py-line">  <tt class="py-keyword">def</tt> <a class="py-def-name" href="keyczar.keyczar.Encrypter-class.html#IsAcceptablePurpose">IsAcceptablePurpose</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">purpose</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Encrypter.IsAcceptablePurpose-collapsed" style="display:none;" pad="+++" indent="++++++"></div><div id="Encrypter.IsAcceptablePurpose-expanded"><a name="L291"></a><tt class="py-lineno">291</tt>  <tt class="py-line">    <tt class="py-docstring">"""Only valid if purpose includes encrypting."""</tt> </tt>
<a name="L292"></a><tt class="py-lineno">292</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">purpose</tt> <tt class="py-op">==</tt> <tt id="link-168" class="py-name"><a title="keyczar.keyinfo" class="py-name" href="#" onclick="return doclink('link-168', 'keyinfo', 'link-3');">keyinfo</a></tt><tt class="py-op">.</tt><tt id="link-169" class="py-name"><a title="keyczar.keyinfo.ENCRYPT" class="py-name" href="#" onclick="return doclink('link-169', 'ENCRYPT', 'link-138');">ENCRYPT</a></tt> <tt class="py-keyword">or</tt> <tt class="py-name">purpose</tt> <tt class="py-op">==</tt> <tt id="link-170" class="py-name"><a title="keyczar.keyinfo" class="py-name" href="#" onclick="return doclink('link-170', 'keyinfo', 'link-3');">keyinfo</a></tt><tt class="py-op">.</tt><tt id="link-171" class="py-name"><a title="keyczar.keyinfo.DECRYPT_AND_ENCRYPT" class="py-name" href="#" onclick="return doclink('link-171', 'DECRYPT_AND_ENCRYPT', 'link-134');">DECRYPT_AND_ENCRYPT</a></tt> </tt>
</div><a name="L293"></a><tt class="py-lineno">293</tt>  <tt class="py-line">   </tt>
<a name="Encrypter.Encrypt"></a><div id="Encrypter.Encrypt-def"><a name="L294"></a><tt class="py-lineno">294</tt> <a class="py-toggle" href="#" id="Encrypter.Encrypt-toggle" onclick="return toggle('Encrypter.Encrypt');">-</a><tt class="py-line">  <tt class="py-keyword">def</tt> <a class="py-def-name" href="keyczar.keyczar.Encrypter-class.html#Encrypt">Encrypt</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">data</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Encrypter.Encrypt-collapsed" style="display:none;" pad="+++" indent="++++++"></div><div id="Encrypter.Encrypt-expanded"><a name="L295"></a><tt class="py-lineno">295</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L296"></a><tt class="py-lineno">296</tt>  <tt class="py-line"><tt class="py-docstring">    Encrypt the data and return the ciphertext.</tt> </tt>
<a name="L297"></a><tt class="py-lineno">297</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L298"></a><tt class="py-lineno">298</tt>  <tt class="py-line"><tt class="py-docstring">    @param data: message to encrypt</tt> </tt>
<a name="L299"></a><tt class="py-lineno">299</tt>  <tt class="py-line"><tt class="py-docstring">    @type data: string</tt> </tt>
<a name="L300"></a><tt class="py-lineno">300</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L301"></a><tt class="py-lineno">301</tt>  <tt class="py-line"><tt class="py-docstring">    @return: ciphertext encoded as a Base64 string</tt> </tt>
<a name="L302"></a><tt class="py-lineno">302</tt>  <tt class="py-line"><tt class="py-docstring">    @rtype: string</tt> </tt>
<a name="L303"></a><tt class="py-lineno">303</tt>  <tt class="py-line"><tt class="py-docstring">      </tt> </tt>
<a name="L304"></a><tt class="py-lineno">304</tt>  <tt class="py-line"><tt class="py-docstring">    @raise NoPrimaryKeyError: if no primary key can be found to encrypt</tt> </tt>
<a name="L305"></a><tt class="py-lineno">305</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L306"></a><tt class="py-lineno">306</tt>  <tt class="py-line">    <tt class="py-name">encrypting_key</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-172" class="py-name"><a title="keyczar.keyczar.Keyczar.primary_key" class="py-name" href="#" onclick="return doclink('link-172', 'primary_key', 'link-36');">primary_key</a></tt> </tt>
<a name="L307"></a><tt class="py-lineno">307</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">encrypting_key</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L308"></a><tt class="py-lineno">308</tt>  <tt class="py-line">      <tt class="py-keyword">raise</tt> <tt id="link-173" class="py-name"><a title="keyczar.errors" class="py-name" href="#" onclick="return doclink('link-173', 'errors', 'link-1');">errors</a></tt><tt class="py-op">.</tt><tt id="link-174" class="py-name" targets="Class keyczar.errors.NoPrimaryKeyError=keyczar.errors.NoPrimaryKeyError-class.html"><a title="keyczar.errors.NoPrimaryKeyError" class="py-name" href="#" onclick="return doclink('link-174', 'NoPrimaryKeyError', 'link-174');">NoPrimaryKeyError</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L309"></a><tt class="py-lineno">309</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt id="link-175" class="py-name"><a title="keyczar.util" class="py-name" href="#" onclick="return doclink('link-175', 'util', 'link-6');">util</a></tt><tt class="py-op">.</tt><tt id="link-176" class="py-name"><a title="keyczar.util.Encode" class="py-name" href="#" onclick="return doclink('link-176', 'Encode', 'link-43');">Encode</a></tt><tt class="py-op">(</tt><tt class="py-name">encrypting_key</tt><tt class="py-op">.</tt><tt id="link-177" class="py-name"><a title="keyczar.keyczar.Encrypter.Encrypt
keyczar.keys.AesKey.Encrypt
keyczar.keys.RsaPrivateKey.Encrypt
keyczar.keys.RsaPublicKey.Encrypt" class="py-name" href="#" onclick="return doclink('link-177', 'Encrypt', 'link-162');">Encrypt</a></tt><tt class="py-op">(</tt><tt class="py-name">data</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L310"></a><tt class="py-lineno">310</tt>  <tt class="py-line">     </tt>
<a name="Verifier"></a><div id="Verifier-def"><a name="L311"></a><tt class="py-lineno">311</tt> <a class="py-toggle" href="#" id="Verifier-toggle" onclick="return toggle('Verifier');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="keyczar.keyczar.Verifier-class.html">Verifier</a><tt class="py-op">(</tt><tt class="py-base-class">Keyczar</tt><tt class="py-op">)</tt><tt class="py-op">:</tt>   </tt>
</div><a name="L312"></a><tt class="py-lineno">312</tt>  <tt class="py-line">  <tt class="py-docstring">"""Capable of verifying only."""</tt> </tt>
<a name="L313"></a><tt class="py-lineno">313</tt>  <tt class="py-line">   </tt>
<a name="L314"></a><tt class="py-lineno">314</tt>  <tt class="py-line">  <tt class="py-decorator">@</tt><tt class="py-decorator">staticmethod</tt> </tt>
<a name="Verifier.Read"></a><div id="Verifier.Read-def"><a name="L315"></a><tt class="py-lineno">315</tt> <a class="py-toggle" href="#" id="Verifier.Read-toggle" onclick="return toggle('Verifier.Read');">-</a><tt class="py-line">  <tt class="py-keyword">def</tt> <a class="py-def-name" href="keyczar.keyczar.Verifier-class.html#Read">Read</a><tt class="py-op">(</tt><tt class="py-param">location</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Verifier.Read-collapsed" style="display:none;" pad="+++" indent="++++++"></div><div id="Verifier.Read-expanded"><a name="L316"></a><tt class="py-lineno">316</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L317"></a><tt class="py-lineno">317</tt>  <tt class="py-line"><tt class="py-docstring">    Return a Verifier object created from FileReader at given location.</tt> </tt>
<a name="L318"></a><tt class="py-lineno">318</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L319"></a><tt class="py-lineno">319</tt>  <tt class="py-line"><tt class="py-docstring">    @param location: pathname of the directory storing the key files</tt> </tt>
<a name="L320"></a><tt class="py-lineno">320</tt>  <tt class="py-line"><tt class="py-docstring">    @type location: string</tt> </tt>
<a name="L321"></a><tt class="py-lineno">321</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L322"></a><tt class="py-lineno">322</tt>  <tt class="py-line"><tt class="py-docstring">    @return: a Verifier to manage the keys stored at the given location and</tt> </tt>
<a name="L323"></a><tt class="py-lineno">323</tt>  <tt class="py-line"><tt class="py-docstring">      perform verify functions.</tt> </tt>
<a name="L324"></a><tt class="py-lineno">324</tt>  <tt class="py-line"><tt class="py-docstring">    @rtype: L{Verifier}</tt> </tt>
<a name="L325"></a><tt class="py-lineno">325</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L326"></a><tt class="py-lineno">326</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt id="link-178" class="py-name" targets="Class keyczar.keyczar.Verifier=keyczar.keyczar.Verifier-class.html"><a title="keyczar.keyczar.Verifier" class="py-name" href="#" onclick="return doclink('link-178', 'Verifier', 'link-178');">Verifier</a></tt><tt class="py-op">(</tt><tt id="link-179" class="py-name"><a title="keyczar.readers" class="py-name" href="#" onclick="return doclink('link-179', 'readers', 'link-5');">readers</a></tt><tt class="py-op">.</tt><tt id="link-180" class="py-name"><a title="keyczar.readers.FileReader" class="py-name" href="#" onclick="return doclink('link-180', 'FileReader', 'link-48');">FileReader</a></tt><tt class="py-op">(</tt><tt class="py-name">location</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="L327"></a><tt class="py-lineno">327</tt>  <tt class="py-line">   </tt>
<a name="Verifier.IsAcceptablePurpose"></a><div id="Verifier.IsAcceptablePurpose-def"><a name="L328"></a><tt class="py-lineno">328</tt> <a class="py-toggle" href="#" id="Verifier.IsAcceptablePurpose-toggle" onclick="return toggle('Verifier.IsAcceptablePurpose');">-</a><tt class="py-line">  <tt class="py-keyword">def</tt> <a class="py-def-name" href="keyczar.keyczar.Verifier-class.html#IsAcceptablePurpose">IsAcceptablePurpose</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">purpose</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Verifier.IsAcceptablePurpose-collapsed" style="display:none;" pad="+++" indent="++++++"></div><div id="Verifier.IsAcceptablePurpose-expanded"><a name="L329"></a><tt class="py-lineno">329</tt>  <tt class="py-line">    <tt class="py-docstring">"""Only valid if purpose includes verifying."""</tt> </tt>
<a name="L330"></a><tt class="py-lineno">330</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">purpose</tt> <tt class="py-op">==</tt> <tt id="link-181" class="py-name"><a title="keyczar.keyinfo" class="py-name" href="#" onclick="return doclink('link-181', 'keyinfo', 'link-3');">keyinfo</a></tt><tt class="py-op">.</tt><tt id="link-182" class="py-name"><a title="keyczar.keyinfo.VERIFY" class="py-name" href="#" onclick="return doclink('link-182', 'VERIFY', 'link-128');">VERIFY</a></tt> <tt class="py-keyword">or</tt> <tt class="py-name">purpose</tt> <tt class="py-op">==</tt> <tt id="link-183" class="py-name"><a title="keyczar.keyinfo" class="py-name" href="#" onclick="return doclink('link-183', 'keyinfo', 'link-3');">keyinfo</a></tt><tt class="py-op">.</tt><tt id="link-184" class="py-name"><a title="keyczar.keyinfo.SIGN_AND_VERIFY" class="py-name" href="#" onclick="return doclink('link-184', 'SIGN_AND_VERIFY', 'link-124');">SIGN_AND_VERIFY</a></tt> </tt>
</div><a name="L331"></a><tt class="py-lineno">331</tt>  <tt class="py-line">   </tt>
<a name="Verifier.Verify"></a><div id="Verifier.Verify-def"><a name="L332"></a><tt class="py-lineno">332</tt> <a class="py-toggle" href="#" id="Verifier.Verify-toggle" onclick="return toggle('Verifier.Verify');">-</a><tt class="py-line">  <tt class="py-keyword">def</tt> <a class="py-def-name" href="keyczar.keyczar.Verifier-class.html#Verify">Verify</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">data</tt><tt class="py-op">,</tt> <tt class="py-param">sig</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Verifier.Verify-collapsed" style="display:none;" pad="+++" indent="++++++"></div><div id="Verifier.Verify-expanded"><a name="L333"></a><tt class="py-lineno">333</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L334"></a><tt class="py-lineno">334</tt>  <tt class="py-line"><tt class="py-docstring">    Verifies whether the signature corresponds to the given data.</tt> </tt>
<a name="L335"></a><tt class="py-lineno">335</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L336"></a><tt class="py-lineno">336</tt>  <tt class="py-line"><tt class="py-docstring">    @param data: message that has been signed with sig</tt> </tt>
<a name="L337"></a><tt class="py-lineno">337</tt>  <tt class="py-line"><tt class="py-docstring">    @type data: string</tt> </tt>
<a name="L338"></a><tt class="py-lineno">338</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L339"></a><tt class="py-lineno">339</tt>  <tt class="py-line"><tt class="py-docstring">    @param sig: Base64 string formatted as Header|Signature</tt> </tt>
<a name="L340"></a><tt class="py-lineno">340</tt>  <tt class="py-line"><tt class="py-docstring">    @type sig: string</tt> </tt>
<a name="L341"></a><tt class="py-lineno">341</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L342"></a><tt class="py-lineno">342</tt>  <tt class="py-line"><tt class="py-docstring">    @return: True if sig corresponds to data, False otherwise.</tt> </tt>
<a name="L343"></a><tt class="py-lineno">343</tt>  <tt class="py-line"><tt class="py-docstring">    @rtype: boolean</tt> </tt>
<a name="L344"></a><tt class="py-lineno">344</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L345"></a><tt class="py-lineno">345</tt>  <tt class="py-line">    <tt class="py-name">sig_bytes</tt> <tt class="py-op">=</tt> <tt id="link-185" class="py-name"><a title="keyczar.util" class="py-name" href="#" onclick="return doclink('link-185', 'util', 'link-6');">util</a></tt><tt class="py-op">.</tt><tt id="link-186" class="py-name" targets="Function keyczar.util.Decode()=keyczar.util-module.html#Decode"><a title="keyczar.util.Decode" class="py-name" href="#" onclick="return doclink('link-186', 'Decode', 'link-186');">Decode</a></tt><tt class="py-op">(</tt><tt class="py-name">sig</tt><tt class="py-op">)</tt> </tt>
<a name="L346"></a><tt class="py-lineno">346</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">sig_bytes</tt><tt class="py-op">)</tt> <tt class="py-op">&lt;</tt> <tt id="link-187" class="py-name"><a title="keyczar.keyczar.HEADER_SIZE" class="py-name" href="#" onclick="return doclink('link-187', 'HEADER_SIZE', 'link-9');">HEADER_SIZE</a></tt><tt class="py-op">:</tt> </tt>
<a name="L347"></a><tt class="py-lineno">347</tt>  <tt class="py-line">      <tt class="py-keyword">raise</tt> <tt id="link-188" class="py-name"><a title="keyczar.errors" class="py-name" href="#" onclick="return doclink('link-188', 'errors', 'link-1');">errors</a></tt><tt class="py-op">.</tt><tt id="link-189" class="py-name" targets="Class keyczar.errors.ShortSignatureError=keyczar.errors.ShortSignatureError-class.html"><a title="keyczar.errors.ShortSignatureError" class="py-name" href="#" onclick="return doclink('link-189', 'ShortSignatureError', 'link-189');">ShortSignatureError</a></tt><tt class="py-op">(</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">sig_bytes</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L348"></a><tt class="py-lineno">348</tt>  <tt class="py-line">    <tt class="py-name">key</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-190" class="py-name" targets="Method keyczar.keyczar.Keyczar._ParseHeader()=keyczar.keyczar.Keyczar-class.html#_ParseHeader"><a title="keyczar.keyczar.Keyczar._ParseHeader" class="py-name" href="#" onclick="return doclink('link-190', '_ParseHeader', 'link-190');">_ParseHeader</a></tt><tt class="py-op">(</tt><tt class="py-name">sig_bytes</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt id="link-191" class="py-name"><a title="keyczar.keyczar.HEADER_SIZE" class="py-name" href="#" onclick="return doclink('link-191', 'HEADER_SIZE', 'link-9');">HEADER_SIZE</a></tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L349"></a><tt class="py-lineno">349</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">key</tt><tt class="py-op">.</tt><tt id="link-192" class="py-name" targets="Method keyczar.keyczar.Verifier.Verify()=keyczar.keyczar.Verifier-class.html#Verify,Method keyczar.keys.DsaPrivateKey.Verify()=keyczar.keys.DsaPrivateKey-class.html#Verify,Method keyczar.keys.DsaPublicKey.Verify()=keyczar.keys.DsaPublicKey-class.html#Verify,Method keyczar.keys.HmacKey.Verify()=keyczar.keys.HmacKey-class.html#Verify,Method keyczar.keys.RsaPrivateKey.Verify()=keyczar.keys.RsaPrivateKey-class.html#Verify,Method keyczar.keys.RsaPublicKey.Verify()=keyczar.keys.RsaPublicKey-class.html#Verify"><a title="keyczar.keyczar.Verifier.Verify
keyczar.keys.DsaPrivateKey.Verify
keyczar.keys.DsaPublicKey.Verify
keyczar.keys.HmacKey.Verify
keyczar.keys.RsaPrivateKey.Verify
keyczar.keys.RsaPublicKey.Verify" class="py-name" href="#" onclick="return doclink('link-192', 'Verify', 'link-192');">Verify</a></tt><tt class="py-op">(</tt><tt class="py-name">sig_bytes</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt id="link-193" class="py-name"><a title="keyczar.keyczar.HEADER_SIZE" class="py-name" href="#" onclick="return doclink('link-193', 'HEADER_SIZE', 'link-9');">HEADER_SIZE</a></tt><tt class="py-op">]</tt> <tt class="py-op">+</tt> <tt class="py-name">data</tt><tt class="py-op">,</tt> <tt class="py-name">sig_bytes</tt><tt class="py-op">[</tt><tt id="link-194" class="py-name"><a title="keyczar.keyczar.HEADER_SIZE" class="py-name" href="#" onclick="return doclink('link-194', 'HEADER_SIZE', 'link-9');">HEADER_SIZE</a></tt><tt class="py-op">:</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L350"></a><tt class="py-lineno">350</tt>  <tt class="py-line"> </tt>
<a name="Crypter"></a><div id="Crypter-def"><a name="L351"></a><tt class="py-lineno">351</tt> <a class="py-toggle" href="#" id="Crypter-toggle" onclick="return toggle('Crypter');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="keyczar.keyczar.Crypter-class.html">Crypter</a><tt class="py-op">(</tt><tt class="py-base-class">Encrypter</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Crypter-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="Crypter-expanded"><a name="L352"></a><tt class="py-lineno">352</tt>  <tt class="py-line">   </tt>
<a name="L353"></a><tt class="py-lineno">353</tt>  <tt class="py-line">  <tt class="py-docstring">"""Capable of encrypting and decrypting."""</tt> </tt>
<a name="L354"></a><tt class="py-lineno">354</tt>  <tt class="py-line"> </tt>
<a name="L355"></a><tt class="py-lineno">355</tt>  <tt class="py-line">  <tt class="py-decorator">@</tt><tt class="py-decorator">staticmethod</tt> </tt>
<a name="Crypter.Read"></a><div id="Crypter.Read-def"><a name="L356"></a><tt class="py-lineno">356</tt> <a class="py-toggle" href="#" id="Crypter.Read-toggle" onclick="return toggle('Crypter.Read');">-</a><tt class="py-line">  <tt class="py-keyword">def</tt> <a class="py-def-name" href="keyczar.keyczar.Crypter-class.html#Read">Read</a><tt class="py-op">(</tt><tt class="py-param">location</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Crypter.Read-collapsed" style="display:none;" pad="+++" indent="++++++"></div><div id="Crypter.Read-expanded"><a name="L357"></a><tt class="py-lineno">357</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L358"></a><tt class="py-lineno">358</tt>  <tt class="py-line"><tt class="py-docstring">    Return a Crypter object created from FileReader at given location.</tt> </tt>
<a name="L359"></a><tt class="py-lineno">359</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L360"></a><tt class="py-lineno">360</tt>  <tt class="py-line"><tt class="py-docstring">    @param location: pathname of the directory storing the key files</tt> </tt>
<a name="L361"></a><tt class="py-lineno">361</tt>  <tt class="py-line"><tt class="py-docstring">    @type location: string</tt> </tt>
<a name="L362"></a><tt class="py-lineno">362</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L363"></a><tt class="py-lineno">363</tt>  <tt class="py-line"><tt class="py-docstring">    @return: a Crypter to manage the keys stored at the given location and</tt> </tt>
<a name="L364"></a><tt class="py-lineno">364</tt>  <tt class="py-line"><tt class="py-docstring">      perform encryption and decryption functions.</tt> </tt>
<a name="L365"></a><tt class="py-lineno">365</tt>  <tt class="py-line"><tt class="py-docstring">    @rtype: L{Crypter}</tt> </tt>
<a name="L366"></a><tt class="py-lineno">366</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L367"></a><tt class="py-lineno">367</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt id="link-195" class="py-name" targets="Class keyczar.keyczar.Crypter=keyczar.keyczar.Crypter-class.html"><a title="keyczar.keyczar.Crypter" class="py-name" href="#" onclick="return doclink('link-195', 'Crypter', 'link-195');">Crypter</a></tt><tt class="py-op">(</tt><tt id="link-196" class="py-name"><a title="keyczar.readers" class="py-name" href="#" onclick="return doclink('link-196', 'readers', 'link-5');">readers</a></tt><tt class="py-op">.</tt><tt id="link-197" class="py-name"><a title="keyczar.readers.FileReader" class="py-name" href="#" onclick="return doclink('link-197', 'FileReader', 'link-48');">FileReader</a></tt><tt class="py-op">(</tt><tt class="py-name">location</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="L368"></a><tt class="py-lineno">368</tt>  <tt class="py-line">   </tt>
<a name="Crypter.IsAcceptablePurpose"></a><div id="Crypter.IsAcceptablePurpose-def"><a name="L369"></a><tt class="py-lineno">369</tt> <a class="py-toggle" href="#" id="Crypter.IsAcceptablePurpose-toggle" onclick="return toggle('Crypter.IsAcceptablePurpose');">-</a><tt class="py-line">  <tt class="py-keyword">def</tt> <a class="py-def-name" href="keyczar.keyczar.Crypter-class.html#IsAcceptablePurpose">IsAcceptablePurpose</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">purpose</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Crypter.IsAcceptablePurpose-collapsed" style="display:none;" pad="+++" indent="++++++"></div><div id="Crypter.IsAcceptablePurpose-expanded"><a name="L370"></a><tt class="py-lineno">370</tt>  <tt class="py-line">    <tt class="py-docstring">"""Only valid if purpose includes decrypting"""</tt> </tt>
<a name="L371"></a><tt class="py-lineno">371</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">purpose</tt> <tt class="py-op">==</tt> <tt id="link-198" class="py-name"><a title="keyczar.keyinfo" class="py-name" href="#" onclick="return doclink('link-198', 'keyinfo', 'link-3');">keyinfo</a></tt><tt class="py-op">.</tt><tt id="link-199" class="py-name"><a title="keyczar.keyinfo.DECRYPT_AND_ENCRYPT" class="py-name" href="#" onclick="return doclink('link-199', 'DECRYPT_AND_ENCRYPT', 'link-134');">DECRYPT_AND_ENCRYPT</a></tt> </tt>
</div><a name="L372"></a><tt class="py-lineno">372</tt>  <tt class="py-line">   </tt>
<a name="Crypter.Decrypt"></a><div id="Crypter.Decrypt-def"><a name="L373"></a><tt class="py-lineno">373</tt> <a class="py-toggle" href="#" id="Crypter.Decrypt-toggle" onclick="return toggle('Crypter.Decrypt');">-</a><tt class="py-line">  <tt class="py-keyword">def</tt> <a class="py-def-name" href="keyczar.keyczar.Crypter-class.html#Decrypt">Decrypt</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">ciphertext</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Crypter.Decrypt-collapsed" style="display:none;" pad="+++" indent="++++++"></div><div id="Crypter.Decrypt-expanded"><a name="L374"></a><tt class="py-lineno">374</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L375"></a><tt class="py-lineno">375</tt>  <tt class="py-line"><tt class="py-docstring">    Decrypts the given ciphertext and returns the plaintext.</tt> </tt>
<a name="L376"></a><tt class="py-lineno">376</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L377"></a><tt class="py-lineno">377</tt>  <tt class="py-line"><tt class="py-docstring">    @param ciphertext: Base64 encoded string ciphertext to be decrypted.</tt> </tt>
<a name="L378"></a><tt class="py-lineno">378</tt>  <tt class="py-line"><tt class="py-docstring">    @type ciphertext: string</tt> </tt>
<a name="L379"></a><tt class="py-lineno">379</tt>  <tt class="py-line"><tt class="py-docstring">      </tt> </tt>
<a name="L380"></a><tt class="py-lineno">380</tt>  <tt class="py-line"><tt class="py-docstring">    @return: plaintext message</tt> </tt>
<a name="L381"></a><tt class="py-lineno">381</tt>  <tt class="py-line"><tt class="py-docstring">    @rtype: string</tt> </tt>
<a name="L382"></a><tt class="py-lineno">382</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L383"></a><tt class="py-lineno">383</tt>  <tt class="py-line"><tt class="py-docstring">    @raise ShortCiphertextError: if length is too short to have Header, IV, Sig</tt> </tt>
<a name="L384"></a><tt class="py-lineno">384</tt>  <tt class="py-line"><tt class="py-docstring">    @raise BadVersionError: if header specifies an illegal version</tt> </tt>
<a name="L385"></a><tt class="py-lineno">385</tt>  <tt class="py-line"><tt class="py-docstring">    @raise BadFormatError: if header specifies an illegal format</tt> </tt>
<a name="L386"></a><tt class="py-lineno">386</tt>  <tt class="py-line"><tt class="py-docstring">    @raise KeyNotFoundError: if key specified in header doesn't exist</tt> </tt>
<a name="L387"></a><tt class="py-lineno">387</tt>  <tt class="py-line"><tt class="py-docstring">    @raise InvalidSignatureError: if the signature can't be verified</tt> </tt>
<a name="L388"></a><tt class="py-lineno">388</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L389"></a><tt class="py-lineno">389</tt>  <tt class="py-line">    <tt class="py-name">data_bytes</tt> <tt class="py-op">=</tt> <tt id="link-200" class="py-name"><a title="keyczar.util" class="py-name" href="#" onclick="return doclink('link-200', 'util', 'link-6');">util</a></tt><tt class="py-op">.</tt><tt id="link-201" class="py-name"><a title="keyczar.util.Decode" class="py-name" href="#" onclick="return doclink('link-201', 'Decode', 'link-186');">Decode</a></tt><tt class="py-op">(</tt><tt class="py-name">ciphertext</tt><tt class="py-op">)</tt> </tt>
<a name="L390"></a><tt class="py-lineno">390</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">data_bytes</tt><tt class="py-op">)</tt> <tt class="py-op">&lt;</tt> <tt id="link-202" class="py-name"><a title="keyczar.keyczar.HEADER_SIZE" class="py-name" href="#" onclick="return doclink('link-202', 'HEADER_SIZE', 'link-9');">HEADER_SIZE</a></tt><tt class="py-op">:</tt> </tt>
<a name="L391"></a><tt class="py-lineno">391</tt>  <tt class="py-line">      <tt class="py-keyword">raise</tt> <tt id="link-203" class="py-name"><a title="keyczar.errors" class="py-name" href="#" onclick="return doclink('link-203', 'errors', 'link-1');">errors</a></tt><tt class="py-op">.</tt><tt id="link-204" class="py-name" targets="Class keyczar.errors.ShortCiphertextError=keyczar.errors.ShortCiphertextError-class.html"><a title="keyczar.errors.ShortCiphertextError" class="py-name" href="#" onclick="return doclink('link-204', 'ShortCiphertextError', 'link-204');">ShortCiphertextError</a></tt><tt class="py-op">(</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">data_bytes</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L392"></a><tt class="py-lineno">392</tt>  <tt class="py-line">    <tt class="py-name">key</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-205" class="py-name"><a title="keyczar.keyczar.Keyczar._ParseHeader" class="py-name" href="#" onclick="return doclink('link-205', '_ParseHeader', 'link-190');">_ParseHeader</a></tt><tt class="py-op">(</tt><tt class="py-name">data_bytes</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt id="link-206" class="py-name"><a title="keyczar.keyczar.HEADER_SIZE" class="py-name" href="#" onclick="return doclink('link-206', 'HEADER_SIZE', 'link-9');">HEADER_SIZE</a></tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L393"></a><tt class="py-lineno">393</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">key</tt><tt class="py-op">.</tt><tt id="link-207" class="py-name" targets="Method keyczar.keyczar.Crypter.Decrypt()=keyczar.keyczar.Crypter-class.html#Decrypt,Method keyczar.keys.AesKey.Decrypt()=keyczar.keys.AesKey-class.html#Decrypt,Method keyczar.keys.RsaPrivateKey.Decrypt()=keyczar.keys.RsaPrivateKey-class.html#Decrypt"><a title="keyczar.keyczar.Crypter.Decrypt
keyczar.keys.AesKey.Decrypt
keyczar.keys.RsaPrivateKey.Decrypt" class="py-name" href="#" onclick="return doclink('link-207', 'Decrypt', 'link-207');">Decrypt</a></tt><tt class="py-op">(</tt><tt class="py-name">data_bytes</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L394"></a><tt class="py-lineno">394</tt>  <tt class="py-line">     </tt>
<a name="Signer"></a><div id="Signer-def"><a name="L395"></a><tt class="py-lineno">395</tt> <a class="py-toggle" href="#" id="Signer-toggle" onclick="return toggle('Signer');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="keyczar.keyczar.Signer-class.html">Signer</a><tt class="py-op">(</tt><tt class="py-base-class">Verifier</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Signer-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="Signer-expanded"><a name="L396"></a><tt class="py-lineno">396</tt>  <tt class="py-line">  <tt class="py-docstring">"""Capable of both signing and verifying."""</tt> </tt>
<a name="L397"></a><tt class="py-lineno">397</tt>  <tt class="py-line">   </tt>
<a name="L398"></a><tt class="py-lineno">398</tt>  <tt class="py-line">  <tt class="py-decorator">@</tt><tt class="py-decorator">staticmethod</tt> </tt>
<a name="Signer.Read"></a><div id="Signer.Read-def"><a name="L399"></a><tt class="py-lineno">399</tt> <a class="py-toggle" href="#" id="Signer.Read-toggle" onclick="return toggle('Signer.Read');">-</a><tt class="py-line">  <tt class="py-keyword">def</tt> <a class="py-def-name" href="keyczar.keyczar.Signer-class.html#Read">Read</a><tt class="py-op">(</tt><tt class="py-param">location</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Signer.Read-collapsed" style="display:none;" pad="+++" indent="++++++"></div><div id="Signer.Read-expanded"><a name="L400"></a><tt class="py-lineno">400</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L401"></a><tt class="py-lineno">401</tt>  <tt class="py-line"><tt class="py-docstring">    Return a Signer object created from FileReader at given location.</tt> </tt>
<a name="L402"></a><tt class="py-lineno">402</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L403"></a><tt class="py-lineno">403</tt>  <tt class="py-line"><tt class="py-docstring">    @param location: pathname of the directory storing the key files</tt> </tt>
<a name="L404"></a><tt class="py-lineno">404</tt>  <tt class="py-line"><tt class="py-docstring">    @type location: string</tt> </tt>
<a name="L405"></a><tt class="py-lineno">405</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L406"></a><tt class="py-lineno">406</tt>  <tt class="py-line"><tt class="py-docstring">    @return: a Signer to manage the keys stored at the given location and</tt> </tt>
<a name="L407"></a><tt class="py-lineno">407</tt>  <tt class="py-line"><tt class="py-docstring">      perform sign and verify functions.</tt> </tt>
<a name="L408"></a><tt class="py-lineno">408</tt>  <tt class="py-line"><tt class="py-docstring">    @rtype: L{Signer}</tt> </tt>
<a name="L409"></a><tt class="py-lineno">409</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L410"></a><tt class="py-lineno">410</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt id="link-208" class="py-name" targets="Class keyczar.keyczar.Signer=keyczar.keyczar.Signer-class.html"><a title="keyczar.keyczar.Signer" class="py-name" href="#" onclick="return doclink('link-208', 'Signer', 'link-208');">Signer</a></tt><tt class="py-op">(</tt><tt id="link-209" class="py-name"><a title="keyczar.readers" class="py-name" href="#" onclick="return doclink('link-209', 'readers', 'link-5');">readers</a></tt><tt class="py-op">.</tt><tt id="link-210" class="py-name"><a title="keyczar.readers.FileReader" class="py-name" href="#" onclick="return doclink('link-210', 'FileReader', 'link-48');">FileReader</a></tt><tt class="py-op">(</tt><tt class="py-name">location</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="L411"></a><tt class="py-lineno">411</tt>  <tt class="py-line">   </tt>
<a name="Signer.IsAcceptablePurpose"></a><div id="Signer.IsAcceptablePurpose-def"><a name="L412"></a><tt class="py-lineno">412</tt> <a class="py-toggle" href="#" id="Signer.IsAcceptablePurpose-toggle" onclick="return toggle('Signer.IsAcceptablePurpose');">-</a><tt class="py-line">  <tt class="py-keyword">def</tt> <a class="py-def-name" href="keyczar.keyczar.Signer-class.html#IsAcceptablePurpose">IsAcceptablePurpose</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">purpose</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Signer.IsAcceptablePurpose-collapsed" style="display:none;" pad="+++" indent="++++++"></div><div id="Signer.IsAcceptablePurpose-expanded"><a name="L413"></a><tt class="py-lineno">413</tt>  <tt class="py-line">    <tt class="py-docstring">"""Only valid if purpose includes signing."""</tt> </tt>
<a name="L414"></a><tt class="py-lineno">414</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">purpose</tt> <tt class="py-op">==</tt> <tt id="link-211" class="py-name"><a title="keyczar.keyinfo" class="py-name" href="#" onclick="return doclink('link-211', 'keyinfo', 'link-3');">keyinfo</a></tt><tt class="py-op">.</tt><tt id="link-212" class="py-name"><a title="keyczar.keyinfo.SIGN_AND_VERIFY" class="py-name" href="#" onclick="return doclink('link-212', 'SIGN_AND_VERIFY', 'link-124');">SIGN_AND_VERIFY</a></tt> </tt>
</div><a name="L415"></a><tt class="py-lineno">415</tt>  <tt class="py-line">   </tt>
<a name="Signer.Sign"></a><div id="Signer.Sign-def"><a name="L416"></a><tt class="py-lineno">416</tt> <a class="py-toggle" href="#" id="Signer.Sign-toggle" onclick="return toggle('Signer.Sign');">-</a><tt class="py-line">  <tt class="py-keyword">def</tt> <a class="py-def-name" href="keyczar.keyczar.Signer-class.html#Sign">Sign</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">data</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Signer.Sign-collapsed" style="display:none;" pad="+++" indent="++++++"></div><div id="Signer.Sign-expanded"><a name="L417"></a><tt class="py-lineno">417</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L418"></a><tt class="py-lineno">418</tt>  <tt class="py-line"><tt class="py-docstring">    Sign given data and return corresponding signature.</tt> </tt>
<a name="L419"></a><tt class="py-lineno">419</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L420"></a><tt class="py-lineno">420</tt>  <tt class="py-line"><tt class="py-docstring">    For message M, outputs the signature as Header|Sig(Header.M).</tt> </tt>
<a name="L421"></a><tt class="py-lineno">421</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L422"></a><tt class="py-lineno">422</tt>  <tt class="py-line"><tt class="py-docstring">    @param data: message to be signed</tt> </tt>
<a name="L423"></a><tt class="py-lineno">423</tt>  <tt class="py-line"><tt class="py-docstring">    @type data: string</tt> </tt>
<a name="L424"></a><tt class="py-lineno">424</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L425"></a><tt class="py-lineno">425</tt>  <tt class="py-line"><tt class="py-docstring">    @return: signature on the data encoded as a Base64 string</tt> </tt>
<a name="L426"></a><tt class="py-lineno">426</tt>  <tt class="py-line"><tt class="py-docstring">    @rtype: string</tt> </tt>
<a name="L427"></a><tt class="py-lineno">427</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L428"></a><tt class="py-lineno">428</tt>  <tt class="py-line">    <tt class="py-name">signing_key</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-213" class="py-name"><a title="keyczar.keyczar.Keyczar.primary_key" class="py-name" href="#" onclick="return doclink('link-213', 'primary_key', 'link-36');">primary_key</a></tt> </tt>
<a name="L429"></a><tt class="py-lineno">429</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">signing_key</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L430"></a><tt class="py-lineno">430</tt>  <tt class="py-line">      <tt class="py-keyword">raise</tt> <tt id="link-214" class="py-name"><a title="keyczar.errors" class="py-name" href="#" onclick="return doclink('link-214', 'errors', 'link-1');">errors</a></tt><tt class="py-op">.</tt><tt id="link-215" class="py-name"><a title="keyczar.errors.NoPrimaryKeyError" class="py-name" href="#" onclick="return doclink('link-215', 'NoPrimaryKeyError', 'link-174');">NoPrimaryKeyError</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L431"></a><tt class="py-lineno">431</tt>  <tt class="py-line">    <tt class="py-name">header</tt> <tt class="py-op">=</tt> <tt class="py-name">signing_key</tt><tt class="py-op">.</tt><tt id="link-216" class="py-name" targets="Method keyczar.keys.Key.Header()=keyczar.keys.Key-class.html#Header"><a title="keyczar.keys.Key.Header" class="py-name" href="#" onclick="return doclink('link-216', 'Header', 'link-216');">Header</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L432"></a><tt class="py-lineno">432</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt id="link-217" class="py-name"><a title="keyczar.util" class="py-name" href="#" onclick="return doclink('link-217', 'util', 'link-6');">util</a></tt><tt class="py-op">.</tt><tt id="link-218" class="py-name"><a title="keyczar.util.Encode" class="py-name" href="#" onclick="return doclink('link-218', 'Encode', 'link-43');">Encode</a></tt><tt class="py-op">(</tt><tt class="py-name">header</tt> <tt class="py-op">+</tt> <tt class="py-name">signing_key</tt><tt class="py-op">.</tt><tt id="link-219" class="py-name" targets="Method keyczar.keyczar.Signer.Sign()=keyczar.keyczar.Signer-class.html#Sign,Method keyczar.keys.DsaPrivateKey.Sign()=keyczar.keys.DsaPrivateKey-class.html#Sign,Method keyczar.keys.HmacKey.Sign()=keyczar.keys.HmacKey-class.html#Sign,Method keyczar.keys.RsaPrivateKey.Sign()=keyczar.keys.RsaPrivateKey-class.html#Sign"><a title="keyczar.keyczar.Signer.Sign
keyczar.keys.DsaPrivateKey.Sign
keyczar.keys.HmacKey.Sign
keyczar.keys.RsaPrivateKey.Sign" class="py-name" href="#" onclick="return doclink('link-219', 'Sign', 'link-219');">Sign</a></tt><tt class="py-op">(</tt><tt class="py-name">header</tt> <tt class="py-op">+</tt> <tt class="py-name">data</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div></div><a name="L433"></a><tt class="py-lineno">433</tt>  <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="keyczar-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            >Keyczar</th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Sun Aug 10 17:05:06 2008
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
